I would like to return the discussion to the original question, now with the real code sample ;-) Look at r21318 of Lazarus (tachart: fixed compilation with fpc 2.5.1, by Vincent).
[BTW, is there any web-interface for browsing Lazarus SVN?] I think it is a typical sample of change required to production code by the restriction we are discussing. Looking at the diff, I'd argue that: 1) Old version was cleaner. 2) New version is _not_ any safer, since any type error in the old code will result in exactly the same consequences with the new one. => So, the additional inconvenience to developer did not pay off. To really address the problem, I think compiler should insert a run-time type check (e.g. the as operator) automatically. This way, original code will continue to work unchanged _and_ the programmer will get a clear exception in the case of error. -- Alexander S. Klenin _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel