Skip to content

Commit d03e26c

Browse files
committed
Avoid constructing typed tree with untyped arguments
1 parent 6224c1e commit d03e26c

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
720720
}
721721

722722
fun1.tpe match {
723-
case err: ErrorType => untpd.cpy.Apply(tree)(fun1, tree.args).withType(err)
723+
case err: ErrorType => untpd.cpy.Apply(tree)(fun1, proto.typedArgs).withType(err)
724724
case TryDynamicCallType => typedDynamicApply(tree, pt)
725725
case _ =>
726726
if (originalProto.isDropped) fun1

tests/neg/i1640.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
object Test extends App {
22
List(1, 2, 3) map (_ match { case x => x + 1 })
3-
List((1, 2)) x (_ match { case (x, z) => x + z }) // error
3+
List((1, 2)) x (_ match { case (x, z) => x + z }) // error // error // error
44
}

tests/neg/i1641.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ package object println { def bippy(x: Int, y: Int, z: Int) = "(Int, Int, Int)" }
33
object Test {
44
def main(args: Array[String]): Unit = {
55
println(bar.bippy(5.5)) // error
6-
println(bar.bippy(1, 2, 3)) // error
6+
println(bar.bippy(1, 2, 3)) // error // error
77
}
88
}

tests/neg/i1707.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object DepBug {
1818
}
1919
{ // error: Null does not take parameters (follow on)
2020
import dep._
21-
a m (b)
21+
a m (b) // error: not found: a
2222
}
2323
dep.a m (dep b) // error (follow on)
2424
}

tests/neg/parser-stability-10.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ def unapply(i1: Int)(i6: List[Int]): Int = {
99
} // error
1010
object i5 {
1111
import collection.mutable._
12-
try { ??? mutable { case i1(i5, i3, i4) => i5 }} // error
12+
try { ??? mutable { case i1(i5, i3, i4) => i5 }} // error // error // error
1313
} // error

tests/neg/parser-stability-6.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class x0 {
2+
1 + x1 * / |= 2 // error: not found: x1
3+
}

tests/neg/t7239.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object Test {
1717
(implicit F0: NoImplicit): HasWithFilter = ???
1818
}
1919

20-
BrokenMethod().withFilter(_ => true) // error
20+
BrokenMethod().withFilter(_ => true) // error // error
2121
BrokenMethod().filter(_ => true) // ok
2222

2323
locally {
@@ -35,6 +35,6 @@ object Test {
3535
// `(B => Boolean)`. Only later during pickling does the
3636
// defensive check for erroneous types in the tree pick up
3737
// the problem.
38-
BrokenMethod().withFilter(x => true) // error
38+
BrokenMethod().withFilter(x => true) // error // error
3939
}
4040
}

0 commit comments

Comments
 (0)