The code in the manual that is actually seemed to be wrong

Viewed 72
1 Answers

try.haxe.org assumes that the class that contains the entry point main() is called Test, while the code example you linked uses Main.

It appears to work fine once you change class Main to class Test in the code snippet: https://try.haxe.org/#68274


Note that some other code examples from the manual may not compile because try.haxe.org still runs Haxe 3.4.4, while the current release is 4.0.5. To work around this, people usually use this fork of try.haxe that lets you specify the Haxe version to use in the options tab:

http://try-haxe.mrcdk.com/

Related