-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does TC correctly handle transitive extend? #744
Comments
If I run that and ask for the locations of all the items in the overload set I get this:
So, the definitions from |
You are right, functions get various identities assigned, and I misread the list of overloaded functions for subtype. Thanks! So the problem must be further downstream. The only thing I observe at the moment is that I am going to check this right now. |
@mahills I think I have isolated the problem related to If there are multiple extends and multiple overloaded definitions of a function across these extends they should all get the same scope assigned I think. The net effect is that the compiler assigns sequence number 0 to Does this analysis make sense to you or am I missing something? |
This makes sense, but I'll have to look to see what I can do about it. They really are defined in different modules, and extending copies the names into scope but doesn't actually make copies of the underlying items (which is why it doesn't adjust the underlying scope IDs, these refer to the containing item, which is still the module they were declared in). |
Ok, then at least the analysis of this issue is established. About its solution:
|
It turns out that the changed approach to overloading resolution in the compiler also solves this problem. |
Consider the following program (inspired by the structure of
types::AbstractType
):The situation is that
ParseTree
extendsType
, andTst4
extendsParseTree
. In additionTst4
extends theSymbol
datatype (defined inParseTree
) and thesubtype
function defined inType
and extended inParseTree
.Looking in the info generated by the type checker,
Tst4::subtype
has all definitions inType
as alternatives but the definitions in ParseTree are missing. Effect: at runtimeParseTree::subtype
cannot be found. Curious detail: addingimport Type;
to the above module solves the problem.This feels like a transitivity problem, @mahills what is your analysis?
The text was updated successfully, but these errors were encountered: