Skip to content

Commit f0c2518

Browse files
committed
Fix #3348: remove assertion as completion may happen in inferImplicit
1 parent 5c36cb8 commit f0c2518

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,6 @@ trait Implicits { self: Typer =>
708708
assert(!ctx.isAfterTyper,
709709
if (argument.isEmpty) i"missing implicit parameter of type $pt after typer"
710710
else i"type error: ${argument.tpe} does not conform to $pt${err.whyNoMatchStr(argument.tpe, pt)}")
711-
val prevConstr = ctx.typerState.constraint
712711
trace(s"search implicit ${pt.show}, arg = ${argument.show}: ${argument.tpe.show}", implicits, show = true) {
713712
assert(!pt.isInstanceOf[ExprType])
714713
val isearch =
@@ -737,7 +736,6 @@ trait Implicits { self: Typer =>
737736
}
738737
else result
739738
case _ =>
740-
assert(prevConstr eq ctx.typerState.constraint)
741739
result
742740
}
743741
}

tests/neg/i3348.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Test {
2+
import Test.test
3+
"Hello".toto // error
4+
}
5+
6+
object Test {
7+
def test = {
8+
implicitly[collection.generic.CanBuildFrom[List[Int], Int, List[Int]]]
9+
}
10+
}

0 commit comments

Comments
 (0)