File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
93
93
def _isInstanceOf (b : Symbol , tp : Type ): Tree
94
94
/* tgt is expected to be a Seq, call tgt.drop(n) */
95
95
def drop (tgt : Tree )(n : Int ): Tree
96
- /* tgt is expected to have method apply(int), call tgt.drop (i) */
96
+ /* tgt is expected to have method apply(int), call tgt.apply (i) */
97
97
def index (tgt : Tree )(i : Int ): Tree
98
98
/* make tree that accesses the i'th component of the tuple referenced by binder */
99
99
def tupleSel (binder : Symbol )(i : Int ): Tree
Original file line number Diff line number Diff line change @@ -33,13 +33,8 @@ import reporting.diagnostic.Message
33
33
object Applications {
34
34
import tpd ._
35
35
36
- def extractorMember (tp : Type , name : Name )(implicit ctx : Context ) = {
37
- def isPossibleExtractorType (tp : Type ) = tp match {
38
- case _ : MethodOrPoly => false
39
- case _ => true
40
- }
41
- tp.member(name).suchThat(d => isPossibleExtractorType(d.info))
42
- }
36
+ def extractorMember (tp : Type , name : Name )(implicit ctx : Context ) =
37
+ tp.member(name).suchThat(_.info.isParameterless)
43
38
44
39
def extractorMemberType (tp : Type , name : Name , errorPos : Position = NoPosition )(implicit ctx : Context ) = {
45
40
val ref = extractorMember(tp, name)
@@ -72,7 +67,8 @@ object Applications {
72
67
if (defn.isProductSubType(tp)) productSelectorTypes(tp).size else - 1
73
68
74
69
def productSelectors (tp : Type )(implicit ctx : Context ): List [Symbol ] = {
75
- val sels = for (n <- Iterator .from(0 )) yield tp.member(nme.selectorName(n)).symbol
70
+ val sels = for (n <- Iterator .from(0 )) yield
71
+ tp.member(nme.selectorName(n)).suchThat(_.info.isParameterless).symbol
76
72
sels.takeWhile(_.exists).toList
77
73
}
78
74
You can’t perform that action at this time.
0 commit comments