-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error tpe obtained for type alias defined in package object #12663
Comments
It seems that the issue only happens if we usage the symbol within the same package. |
The REPL effect:
I cut/pasted a pc test.
|
This only seem to happen when they are located within a separate file and the input to the compiler is an actual compiled classfile. |
Thanks, the pc test "just works" when splitting the package object into its own "compilation round" and indeed shows no completions. I'll take a look despite/because not knowing anything about it.
|
Just want to mention that the impact of this can be pretty bad when developing on some projects with Metals. Lots of hover / go-to-definition / completion were not working in coursier before coursier/coursier#2900. Same right now on the Mill codebase, that relies quite a bit on package objects. |
I don't remember my previous comment, but I'll take a swing this week. By coincidence, I was going to do a Mill bounty but maybe this instead. I don't think anyone else has free time to spare? Free as in beer. I just started trying out metals with vscode and wanted to learn how to build/test. I noticed that metals uses twitter as an announcement channel, even though it doesn't conform to the Scala code of conduct. |
Let me know if you need any help! |
Issue originally raised in Metals - scalameta/metals#4495
Reproduction steps
Scala version: 2.13.8, 2.13.9, probably earlier ones too
Here's repo with reproduction.
a/package.scala
a/Main.scala
Problem
There are no completions for type alias
I initially thought that this is the problem with Metals but @tgodzik created a testcase with reproduction https://github.com/scalameta/metals/compare/main...tgodzik:metals:add-test?expand=1 which shows that this is the compiler issue.
This is what Metals gets from compiler:
note
tpe = <error>
forn
whereask
has correct tpe.The text was updated successfully, but these errors were encountered: