Update to newest haxe version.
This commit is contained in:
2
.haxerc
2
.haxerc
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"version": "4.0.0-rc.3",
|
||||
"version": "e552bdc",
|
||||
"resolveLibs": "scoped"
|
||||
}
|
@@ -1,3 +1,3 @@
|
||||
# @install: lix --silent download "haxelib:tink_core#1.16.1" into tink_core/1.16.1/haxelib
|
||||
-D tink_core=1.16.1
|
||||
-cp ${HAXESHIM_LIBCACHE}/tink_core/1.16.1/haxelib/src
|
||||
-D tink_core=1.24.0
|
||||
# @install: lix --silent download "haxelib:/tink_core#1.24.0" into tink_core/1.24.0/haxelib
|
||||
-cp ${HAXE_LIBCACHE}/tink_core/1.24.0/haxelib/src
|
||||
|
@@ -4,9 +4,18 @@ import haxe.macro.Expr;
|
||||
|
||||
using tink.macro.Exprs;
|
||||
|
||||
#if haxe4
|
||||
private abstract Kind(FunctionKind) from FunctionKind to FunctionKind {
|
||||
@:from static function ofString(s:String):Kind
|
||||
return FNamed(s);
|
||||
}
|
||||
#else
|
||||
private typedef Kind = String;
|
||||
#end
|
||||
|
||||
class Functions {
|
||||
static public inline function asExpr(f:Function, ?name, ?pos)
|
||||
return EFunction(name, f).at(pos);
|
||||
static public inline function asExpr(f:Function, ?kind:Kind, ?pos)
|
||||
return EFunction(kind, f).at(pos);
|
||||
|
||||
static public inline function toArg(name:String, ?t, ?opt = false, ?value = null):FunctionArg {
|
||||
return {
|
||||
|
11
tests/Functions.hx
Normal file
11
tests/Functions.hx
Normal file
@@ -0,0 +1,11 @@
|
||||
import haxe.macro.Context;
|
||||
import haxe.macro.Expr;
|
||||
using tink.MacroApi;
|
||||
|
||||
class Functions extends Base {
|
||||
function test() {
|
||||
var f:Function = (macro function () {}).getFunction().sure();
|
||||
f.asExpr('foo');
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
@@ -12,6 +12,7 @@ class Run {
|
||||
new Types(),
|
||||
new Positions(),
|
||||
new TypeMapTest(),
|
||||
new Functions(),
|
||||
new Misc(),
|
||||
];
|
||||
#end
|
||||
|
Reference in New Issue
Block a user