On Thu, 28 May 2015 02:12:10 +0000, Mike wrote: > Shouldn't it be able to inline the "add" function since the source code > is there in the testInline.d file? Should I file a bug?
actually, the code is not available, as ".d" file is treated like ".di" file here, i.e. file with only interface declarations. fixing this will require to change frontend to distinguish between ".d" and ".di" files, and will be inconsistent. but you can fix your code instead: declare your function as template: @inline int add()(int a, int b) { return a+b; } this way it will work, and it will be consistent, as ".di" files includes source for templates.
signature.asc
Description: PGP signature