On Friday, 30 November 2012 at 20:40:23 UTC, Jonathan M Davis
wrote:
It can't be evaluated at compile time because of .di files. The
compiler
doesn't necessarily have all of the source to work with -
including the static
constructors - and if it doesn't have that, it can't do it. If
anything figures
this out automatically, it has to be the runtime. If we can do
that, great,
but it means that it'll have actually have to look at
individual symbols
rather than just at the module level like it's doing now, and
right now, we
have nothing even close to that. Regardless, while the compiler
may be able
to provide additional information to the runtime, it's still
the runtime that
needs to figure this out and not the compiler.
I'd bet you can solve most cases anyway.