Created
January 3, 2016 14:51
-
-
Save boozook/7142db7b174097f6b7f0 to your computer and use it in GitHub Desktop.
Haxe issue #4763 (compilable)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-main Main | |
-x main.n | |
-D dump=pretty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ; | |
import haxe.macro.*; | |
import haxe.macro.Expr; | |
import haxe.macro.Type; | |
class Main | |
{ | |
static var A:String = getConstA(); | |
static var B:String = getConstB(); | |
// Main.hx:9: characters 15-42 : Inline variable initialization must be a constant value | |
// Main.hx:10: characters 15-42 : Inline variable initialization must be a constant value | |
// I think this should not happen when macro returns Const value. | |
static macro function getConstA() | |
return macro "I'm a Const!"; | |
static macro function getConstB() | |
return {expr:EConst(CString("I'm a Const too!")), pos:Context.currentPos()}; | |
public static function main(){} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment