-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove warnings #3320
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
Remove warnings #3320
Conversation
@@ -178,8 +178,8 @@ object FrontEndUtils { | |||
def transpose[A](xs: List[List[A]]): List[List[A]] = { | |||
@tailrec def transpose(xs: List[List[A]], result: List[List[A]]): List[List[A]] = { | |||
xs.filter(_.nonEmpty) match { | |||
case Nil => result | |||
case ys: List[List[A]] => transpose(ys.map(_.tail), ys.map(_.head) :: result) |
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.
This looks like a bug. Scalac doesn't report a warning
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.
You are right, we already know that the list is a list of list of A. There is no runtime check needed.
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.
It might due to #3208
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.
Probably not, this is just a warning about erasure.
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 created #3323
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.
Though I would merge this change as the : List[List[A]]
is absolutely useless.
@@ -1523,9 +1523,9 @@ object Types { | |||
if (mySig == null) mySig = Signature.NotAMethod | |||
case designator: Symbol => | |||
uncheckedSetSym(designator) | |||
case LocalName(underlying, space) => |
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.
Is the warning valid here?
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.
Yes
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.
Can you explain why? =)
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.
[warn] -- Warning: /Users/nicolasstucki/GitHub/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:1543:22
[warn] 1543 | case LocalName(underlying, space) =>
[warn] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[warn] |There is no best instantiation of pattern type dotty.tools.dotc.core.Designators.LocalName[dotty.tools.dotc.core.Names.Name]
[warn] |that makes it a subtype of selector type dotty.tools.dotc.core.Designators.Designator.
[warn] |Non-variant type variable N cannot be uniquely instantiated.
[warn] |(This would be an error under strict mode)
We are pattern matching on a Designator { type ThisType <: Name }
but we try to match it against a LocalName[N <: Name] { type ThisType = N }
. Note that the designator does not define the N
type parameter. With these constraints we could instantiate N = Typename
or N = TermName
.
@@ -67,6 +61,7 @@ object references { | |||
s"$title: $byName${ref.showReference}$repeated" | |||
|
|||
case ConstantReference(title) => title | |||
case EmptyReference => "" |
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.
Does it ever happen?
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 did no happen so far. Will put an assert
No description provided.