Skip to content

Commit bd14d11

Browse files
committed
Add neg test to show it no longer crashes
1 parent 6fe165f commit bd14d11

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ object Trees {
116116
assert(!Config.checkUnreportedErrors ||
117117
ctx.reporter.errorsReported ||
118118
ctx.settings.YshowPrintErrors.value
119-
// under -Yprint-show-errors, errors might arise during printing, but they do not count as reported
119+
// under -Yshow-print-errors, errors might arise during printing, but they do not count as reported
120120
)
121121
else if (Config.checkTreesConsistent)
122122
checkChildrenTyped(productIterator)

tests/neg/i3703.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package bar {
2+
trait M[F[_]]
3+
class S[XS[_] <: M[XS], A](val x: XS[A])
4+
object S {
5+
def apply[X[_] <: M[X], A](x: X[A]): S[X, A] = S[X, A](x)
6+
def unapply[X[_] <: M[X], A](p: S[X, A]): S[X, A] = S(p.x) // error, scalac allows this but dotty fails to infer the type arguments.
7+
}
8+
}
9+
10+
11+

0 commit comments

Comments
 (0)