We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2bb42d5 + 3d67ee4 commit c74dde2Copy full SHA for c74dde2
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -158,7 +158,8 @@ class Typer extends Namer
158
*/
159
def qualifies(denot: Denotation): Boolean =
160
reallyExists(denot)
161
- && !(pt.isInstanceOf[UnapplySelectionProto] && denot.symbol.is(Method, butNot = Accessor))
+ && (!pt.isInstanceOf[UnapplySelectionProto]
162
+ || denot.hasAltWith(sd => !sd.symbol.is(Method, butNot = Accessor)))
163
&& !denot.symbol.is(PackageClass)
164
165
/** Find the denotation of enclosing `name` in given context `ctx`.
tests/pos/i11421.scala
@@ -0,0 +1,9 @@
1
+class Foo {
2
+ def ::(hd: String): Foo = ???
3
+ def ::(hd: Boolean): Foo = ???
4
+
5
+ List(1, 2) match {
6
+ case x :: tail => ()
7
+ case _ => ()
8
+ }
9
+}
0 commit comments