Handle module types properly.
This commit is contained in:
@@ -99,10 +99,16 @@ class Sisyphus {
|
|||||||
}
|
}
|
||||||
static function toTypePath(baseType : BaseType, params : Array<Type>) : TypePath return {
|
static function toTypePath(baseType : BaseType, params : Array<Type>) : TypePath return {
|
||||||
var module = baseType.module;
|
var module = baseType.module;
|
||||||
|
var name = module.substring(module.lastIndexOf(".") + 1);
|
||||||
|
var sub = switch baseType.name {
|
||||||
|
case _ == name => true: null;
|
||||||
|
case v: v;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
pack: baseType.pack,
|
pack: baseType.pack,
|
||||||
name: module.substring(module.lastIndexOf(".") + 1),
|
name: name,
|
||||||
sub: baseType.name,
|
sub: sub,
|
||||||
params: [ for (t in params) TPType(toComplexType(t)) ],
|
params: [ for (t in params) TPType(toComplexType(t)) ],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,4 +44,9 @@ class Types extends Base {
|
|||||||
|
|
||||||
MacroApi.pos().makeBlankType().toString();
|
MacroApi.pos().makeBlankType().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testToComplex() {
|
||||||
|
assertEquals('String', Context.getType('String').toComplex().toString());
|
||||||
|
assertEquals('tink.CoreApi.Noise', Context.getType('tink.CoreApi.Noise').toComplex().toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user