On 8/9/17 7:52 PM, Johnson Jones wrote:
given somethign like Threads.threadsAddIdle
which takes an extern(C) int (void*)
we can't seem to do
threadsAddIdle((void*) { }, null);
Because D tries to avoid situations where the type depends on the usage.
The implied type is based solely on the expression (in most cases, there
are a few cases where it is affected by usage).
FYI I also code in swift, and I run into situations all the time where
the compiler can't figure out types for a statement because it hits some
weird corner case that causes too much recursion in the compiler. In
those cases, the compiler says "please split up your statement into
multiple lines". So I'm kind of glad D doesn't go this route, as nice as
it is conceptually.
-Steve