Added support for explicitly direct type -> complextype translation.

This commit is contained in:
back2dos
2013-10-17 10:31:47 +02:00
parent 64cc8c8ea7
commit 0d6ee48067
3 changed files with 7 additions and 4 deletions

View File

@@ -202,8 +202,10 @@ class Types {
static function baseToComplex(t:BaseType, params:Array<Type>)
return asComplexType(t.module + '.' + t.name, paramsToComplex(params));
static public function toComplex(type:Type):ComplexType {
var ret = haxe.macro.TypeTools.toComplexType(type);
static public function toComplex(type:Type, ?options:{ ?direct: Bool }):ComplexType {
var ret =
if (options == null || options.direct != true) haxe.macro.TypeTools.toComplexType(type);
else null;
if (ret == null)
ret = lazyComplex(function () return type);
return ret;