Skip to content

Commit

Permalink
implement missing pieces of resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Feb 25, 2025
1 parent 40f189c commit d61601c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ public TypeRepresentation getExportedMethod(TypeScopeReference type, String name
// TODO filtering only/hiding (see above) - for now we just return everything
return methodResolutionAlgorithm.getExportedMethod(referredModuleScope, type, name);
}

public TypeRepresentation getConversionForType(
TypeScopeReference target, TypeScopeReference source) {
return referredModuleScope.getConversionFor(target, source);
}

public TypeRepresentation getExportedConversion(
TypeScopeReference target, TypeScopeReference source) {
return methodResolutionAlgorithm.getExportedConversion(referredModuleScope, target, source);
}
}

public QualifiedName getReferredModuleName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,13 @@ protected TypeRepresentation getExportedMethodFromScope(
@Override
protected TypeRepresentation getConversionFromScope(
StaticImportExportScope scope, TypeScopeReference target, TypeScopeReference source) {
// TODO conversions can also have optional arguments, we should include this
// boolean hasConversion = scope.resolve(moduleResolver, this).getMethodForType()
// TODO...
return null;
return scope.resolve(moduleResolver, this).getConversionForType(target, source);
}

@Override
protected TypeRepresentation getExportedConversionFromScope(
StaticImportExportScope scope, TypeScopeReference target, TypeScopeReference source) {
// TODO conversions in static analysis
return null;
return scope.resolve(moduleResolver, this).getExportedConversion(target, source);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,9 @@ public TypeRepresentation getConversionFor(TypeScopeReference target, TypeScopeR
public AtomTypeDefinition getType(String name) {
return typesDefinedHere.get(name);
}

@Override
public String toString() {
return "StaticModuleScope{" + moduleName + "}";
}
}

0 comments on commit d61601c

Please sign in to comment.