[Swift-devel] Procedure re-defintion, feature or bug ?

Mihael Hategan hategan at mcs.anl.gov
Wed Aug 10 01:28:44 CDT 2011


On Wed, 2011-08-10 at 11:26 +0530, Yadu Nand wrote:

> What I think is, the procedures are overwritten around compile
> time

Not quite. Just that they are both defined before any of the
invocations. The swift compiler re-orders instructions quite a bit, so
the actual execution order is quite unrelated to the lexical order.

That's exactly why I think that this shouldn't happen. There is no way
to invoke the first definition, so why allow it?

>  which allows this behavior, in which only the last definition
> is valid by execution time.
> 
> 





More information about the Swift-devel mailing list