-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix #13320: add .type to modules in messages #13374
Conversation
test coverage? |
I can try to write a test case for it.
Above should with the fix now give these errors when scalac:
Would that be an ok test case? Where to add it and how to name it? |
I think the test should go in Each line of the More info on testing with checkfiles may be found here: https://dotty.epfl.ch/docs/contributing/testing.html#testing-with-checkfiles |
Thanks @griggt (I'll check this out in some week or so when I have gotten my course going...) |
@@ -300,14 +300,14 @@ import transform.SymUtils._ | |||
|
|||
// The names of all non-synthetic, non-private members of `site` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The names of all non-synthetic, non-private members of `site` | |
// The symbols of all non-synthetic, non-private members of `site` |
@@ -325,11 +325,11 @@ import transform.SymUtils._ | |||
|
|||
// A list of possible candidate strings with their Levenstein distances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// A list of possible candidate strings with their Levenstein distances | |
// A list of possible candidate symbols with their Levenstein distances |
.map(n => (distance(n, missing), n)) | ||
.filter((d, n) => d <= maxDist && d < missing.length && d < n.length) | ||
.sorted // sort by distance first, alphabetically second | ||
.map(n => (distance(n.name.show, missing), n)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For less confusion I would advise to rename n
to s
all around here as we're now dealing with symbols instead of names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use sym
here (as in val candidates = ...
) !
s" - did you mean $siteName.$n?$enumClause" | ||
val showName = | ||
// Add .type to the name if it is a module | ||
if n.isClass && n.is(Module) then s"${n.name.show}.type" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you should get the same result with .is(ModuleClass)
instead of checking two conditions
co-authored by: Anatolii Kmetiuk anatoliykmetyuk@gmail.com
364a75e
to
4073d24
Compare
Co-authored-by: Michał Pałka <prolativ@users.noreply.github.com>
🎉 |
co-authored by: Anatolii Kmetiuk