File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
240240 val isDefined = extractorMemberType(prev.tpe, nme.isDefined)
241241
242242 if ((isDefined isRef defn.BooleanClass ) && getTp.exists) {
243- // isDefined and get maybe overloaded
243+ // isDefined and get may be overloaded
244244 val getDenot = prev.tpe.member(nme.get).suchThat(_.info.isParameterless)
245245 val isDefinedDenot = prev.tpe.member(nme.isDefined).suchThat(_.info.isParameterless)
246246
Original file line number Diff line number Diff line change 1+ class Casey1 [T ](val a : T ) {
2+ def isDefined : Boolean = true
3+ def isDefined (x : T ): Boolean = ???
4+ def get : T = a
5+ def get (x : T ): String = ???
6+ }
7+ object Casey1 { def unapply [T ](a : Casey1 [T ]) = a }
8+
9+ object Test {
10+ def main (args : Array [String ]): Unit = {
11+ val c @ Casey1 (x) = new Casey1 (0 )
12+ assert(x == c.get)
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments