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 {
|
||||
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,
|
||||
name: module.substring(module.lastIndexOf(".") + 1),
|
||||
sub: baseType.name,
|
||||
name: name,
|
||||
sub: sub,
|
||||
params: [ for (t in params) TPType(toComplexType(t)) ],
|
||||
}
|
||||
}
|
||||
|
@@ -44,4 +44,9 @@ class Types extends Base {
|
||||
|
||||
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