--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Thanks! That is something I also had in mind, but:- this solution will not allow me only to warn at compile time
- this solution will not convert the strictly typed event to string
I'm rather looking for a general macro based solution, I think ;)
package;
import haxe.macro.Expr;
import haxe.macro.Context;
import haxe.PosInfos;
class Tset {
static private inline var DERP:String = "DERP";
macro static public function print(string:ExprOf<String>):Expr{
var expr = macro trace("from code " + $string);
switch(string.expr){
case EConst(c): switch (c){
case CString(str): //url is a constant String
Context.warning('Please do not use inline strings, define them as inline instead', Context.currentPos());
default:
}
default:
}
return expr;
}
public static function main() {
trace("hello");
print("lolz");
print(DERP);
}
}