diff --git a/src/tink/macro/Types.hx b/src/tink/macro/Types.hx index 4a40208..87b8445 100644 --- a/src/tink/macro/Types.hx +++ b/src/tink/macro/Types.hx @@ -13,6 +13,16 @@ using tink.macro.Functions; using tink.CoreApi; class Types { + + static public function definedType(typeName:String) + return + try { + Some(Context.getType(typeName)); + } + catch (e:Dynamic) + if (Std.string(e) == 'Type not found \'$typeName\'') None; + else neko.Lib.rethrow(e); + static var types = new MapType>(); static var idCounter = 0; static public function getID(t:Type, ?reduced = true)