Err compile time interpreter my function!

Zaher Dirkey via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 26 00:32:39 PST 2014


Hi, i need help to find strange error in my project

https://github.com/zaher/d-sard

if you have time to compile it and test.

src/sard/classes.d

class SardObjects(T: SardObject): SardObject
  ....
     void afterAdd(T object){
       debug{
         //writeln(this.classinfo.name ~ ".add:" ~ 
object.classinfo.name);
         writeln("This is not compiled line");
       }
     }

I added "writeln" to the function afterAdd in base class/template 
the compiler stop compiler

it work if i commented all adding objects in function created in 
class SrdEnvironment line about 1515
but there is object used the same add function in scanner.d/class 
SrdLexical: SardLexical line 817, it is work there, if i moved 
controls and operators from Envirement to Lexical it compiled, 
only in Envirement not work.

I can't recognize the error there, why compiler need to interpret 
it in compiler time?

-----
Error: fprintf cannot be interpreted at compile time, because it 
has no available source 
code	C:\D\dmd2\src\phobos\std\stdio.d	2537	
called from here: enforce(fprintf((*stdout._p).handle, 
"%.*s\x0a", cast(int)_param_0.length, 
cast(immutable(char)*)_param_0) >= 0, delegate const(char)[]() => 
null, 
"C:\\D\\dmd2\\windows\\bin\\..\\..\\src\\phobos\\std\\stdio.d", 
2537u)	C:\D\dmd2\src\phobos\std\stdio.d	2537	
called from here: writeln("This is not compiled 
line")	W:\home\d\lib\sard\src\sard\classes.d	94	
called from here: 
this.afterAdd(object)	W:\home\d\lib\sard\src\sard\classes.d	100	
called from here: 
super.add(c)	W:\home\d\lib\sard\src\sard\objects.d	1109	
called from here: __withSym.add("(", 
cast(SardControl)9)	W:\home\d\lib\sard\src\sard\objects.d	1515	
called from here: 
this.created()	W:\home\d\lib\sard\src\sard\classes.d	68	
called from here: 
super.this()	W:\home\d\lib\sard\src\sard\objects.d	1550	
----


More information about the Digitalmars-d mailing list