fix resolving imported enclosed types

This commit is contained in:
Dave Holoway
2020-06-17 00:09:49 +01:00
parent fe28924e0c
commit 1c8eb75b4f

View File

@@ -311,10 +311,9 @@ function resolveTypeOrPackage(ident, type_variables, scope, imports, typemap) {
}
if (!types[0]) {
// is it a top-level type from the imports
const top_level_type = '/' + ident;
// is it a type from the imports
for (let i of imports) {
const fqn = i.fullyQualifiedNames.find(fqn => fqn.endsWith(top_level_type));
const fqn = i.fullyQualifiedNames.find(fqn => fqn.endsWith(ident) && /[$/]/.test(fqn[fqn.length-ident.length-1]));
if (fqn) {
types.push(i.types.get(fqn));
}