Skip to content

Instantly share code, notes, and snippets.

@jasononeil
Created September 15, 2013 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasononeil/6569404 to your computer and use it in GitHub Desktop.
Save jasononeil/6569404 to your computer and use it in GitHub Desktop.
In Haxe, a member trace() method does not have priority over the haxe.Log.trace()
import haxe.PosInfos;
class TraceMemberMethod
{
static function main() new TraceMemberMethod();
public function new() {
messages = [];
trace( "hey" ); // Uses haxe.Log.trace()
this.trace( "hey" ); // Uses this.trace()
}
var messages:Array<String>;
public function trace( v:Dynamic, ?p:PosInfos ) {
messages.push( '$v' );
}
}
@jasononeil
Copy link
Author

It would be nice if Haxe respected a local trace() over the global one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment