Skip to content

Commit 1d62808

Browse files
committed
Fix #7751: Weaken an assertion for erroneous programs
1 parent 9aa7991 commit 1d62808

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ trait TypeAssigner {
570570
}
571571

572572
def assignType(tree: untpd.AppliedTypeTree, tycon: Tree, args: List[Tree])(implicit ctx: Context): AppliedTypeTree = {
573-
assert(!hasNamedArg(args))
573+
assert(!hasNamedArg(args) || ctx.reporter.errorsReported, tree)
574574
val tparams = tycon.tpe.typeParams
575575
val ownType =
576576
if (sameLength(tparams, args))

tests/neg/i7751.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
val a = Some(a=a,)=> // error // error
2+
val a = Some(x=y,)=> // error

0 commit comments

Comments
 (0)