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"
|
"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.24.0
|
||||||
-D tink_core=1.16.1
|
# @install: lix --silent download "haxelib:/tink_core#1.24.0" into tink_core/1.24.0/haxelib
|
||||||
-cp ${HAXESHIM_LIBCACHE}/tink_core/1.16.1/haxelib/src
|
-cp ${HAXE_LIBCACHE}/tink_core/1.24.0/haxelib/src
|
||||||
|
|||||||
@@ -4,9 +4,18 @@ import haxe.macro.Expr;
|
|||||||
|
|
||||||
using tink.macro.Exprs;
|
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 {
|
class Functions {
|
||||||
static public inline function asExpr(f:Function, ?name, ?pos)
|
static public inline function asExpr(f:Function, ?kind:Kind, ?pos)
|
||||||
return EFunction(name, f).at(pos);
|
return EFunction(kind, f).at(pos);
|
||||||
|
|
||||||
static public inline function toArg(name:String, ?t, ?opt = false, ?value = null):FunctionArg {
|
static public inline function toArg(name:String, ?t, ?opt = false, ?value = null):FunctionArg {
|
||||||
return {
|
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 Types(),
|
||||||
new Positions(),
|
new Positions(),
|
||||||
new TypeMapTest(),
|
new TypeMapTest(),
|
||||||
|
new Functions(),
|
||||||
new Misc(),
|
new Misc(),
|
||||||
];
|
];
|
||||||
#end
|
#end
|
||||||
|
|||||||
Reference in New Issue
Block a user