-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Incorrect type shown in language server's hover over suffixed expressions #7126
Comments
My guess is that we are messing up the regions with desugaring of the suffixes, and that is somehow related. |
That could be it. I checked the output ast from this example by generating a .snap file from snapshot
I'm not very familiar with this but it looks like the Defs node with Also, is there a better way to print out parts of the ast than creating a snapshot file? I couldn't find anything |
I think making a test is the easiest way. You could also add a test for the parser if you want the AST before it's been desugared which may help see the regions easier see |
When hovering over the values in the file below the types shown are incorrect for everything in main, except for
test2
andStdin.line!
Expected behavior
The types of the values when hovering should be
test1
,"testing"
:Str
test2
:Str
Stdin.line!
:Task {} [...]
test3
,1_2_3
:Num *
Task.ok
:{} -> Task {} *
{}
:{}
Actual behaviour
test2
:Str
Stdin.line!
:Task {} [...]
everything else in main:
Str -> Task {} [...]
I believe the problem is in
roc_can::traverse::TypeAtPositionVisitor
androc_can::traverse::find_closest_type_at
which finds the type of the closure generated by the canonicalization of!
instead of the proper definition.The same thing happens with
?
suffix as well.The text was updated successfully, but these errors were encountered: