Skip to content

Commit b71650f

Browse files
committed
Fix wrong test in PatMat.
Call drop method directly if class derives from sequence. I do not understand how callRuntime works in scalac. Calling this method requires implicit search.
1 parent 7269b37 commit b71650f

File tree

3 files changed

+1
-1
lines changed

3 files changed

+1
-1
lines changed

src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
136136
def callDirect = tgt.select(nme.drop).appliedTo(Literal(Constant(n)))
137137
def callRuntime = ref(defn.traversableDropMethod).appliedTo(tgt, Literal(Constant(n)))
138138

139-
def needsRuntime = tgt.tpe derivesFrom defn.SeqClass /*typeOfMemberNamedDrop(tgt.tpe) == NoType*/
139+
def needsRuntime = !(tgt.tpe derivesFrom defn.SeqClass) /*typeOfMemberNamedDrop(tgt.tpe) == NoType*/
140140

141141
if (needsRuntime) callRuntime else callDirect
142142
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)