Skip to content

Commit 6e80157

Browse files
committed
Enable scala.Dynamic pending/untried tests.
1 parent 8f17872 commit 6e80157

21 files changed

+21
-25
lines changed

tests/untried/neg/applydynamic_sip.scala renamed to tests/neg/applydynamic_sip.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ object Test extends App {
44
val a = "a"
55
val a2 = "a2"
66

7-
qual.sel(a, a2: _*)
8-
qual.sel(arg = a, a2: _*)
9-
qual.sel(arg, arg2 = "a2", a2: _*)
7+
qual.sel(a, a2: _*) // error
8+
qual.sel(arg = a, a2: _*) // error // error
9+
qual.sel(arg, arg2 = "a2", a2: _*) // error // error
1010

1111
val bad1 = new Dynamic {
1212
def selectDynamic(n: Int) = n
@@ -15,19 +15,19 @@ object Test extends App {
1515
def updateDynamic(n: Int) = n
1616

1717
}
18-
bad1.sel
19-
bad1.sel(1)
20-
bad1.sel(a = 1)
21-
bad1.sel = 1
18+
bad1.sel // error
19+
bad1.sel(1) // error
20+
bad1.sel(a = 1) // error // error
21+
bad1.sel = 1 // error // error
2222

2323
val bad2 = new Dynamic {
2424
def selectDynamic = 1
2525
def applyDynamic = 1
2626
def applyDynamicNamed = 1
2727
def updateDynamic = 1
2828
}
29-
bad2.sel
30-
bad2.sel(1)
31-
bad2.sel(a = 1)
32-
bad2.sel = 1
29+
bad2.sel // error
30+
bad2.sel(1) // error
31+
bad2.sel(a = 1) // error // error
32+
bad2.sel = 1 // error
3333
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
t6355b.scala:14: error: value applyDynamic is not a member of A
22
error after rewriting to x.<applyDynamic: error>("bippy")
33
possible cause: maybe a wrong Dynamic method signature?
4-
println(x.bippy(42))
4+
println(x.bippy(42)) // error
55
^
66
t6355b.scala:15: error: value applyDynamic is not a member of A
77
error after rewriting to x.<applyDynamic: error>("bippy")
88
possible cause: maybe a wrong Dynamic method signature?
9-
println(x.bippy("42"))
9+
println(x.bippy("42")) // error
1010
^
1111
two errors found

tests/untried/neg/t6355b.scala renamed to tests/neg/t6355b.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class B(method: String) {
1111
object Test {
1212
def main(args: Array[String]): Unit = {
1313
val x = new A
14-
println(x.bippy(42))
15-
println(x.bippy("42"))
14+
println(x.bippy(42)) // error
15+
println(x.bippy("42")) // error
1616
}
1717
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
t6920.scala:9: error: too many arguments for method applyDynamicNamed: (values: Seq[(String, Any)])String
22
error after rewriting to CompilerError.this.test.applyDynamicNamed("crushTheCompiler")(scala.Tuple2("a", 1), scala.Tuple2("b", 2))
33
possible cause: maybe a wrong Dynamic method signature?
4-
test.crushTheCompiler(a = 1, b = 2)
4+
test.crushTheCompiler(a = 1, b = 2) // error
55
^
66
one error found

tests/untried/neg/t6920.scala renamed to tests/neg/t6920.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class DynTest extends Dynamic {
66

77
class CompilerError {
88
val test = new DynTest
9-
test.crushTheCompiler(a = 1, b = 2)
9+
test.crushTheCompiler(a = 1, b = 2) // error
1010
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
t8006.scala:3: error: too many arguments for method applyDynamicNamed: (value: (String, Any))String
22
error after rewriting to X.this.d.applyDynamicNamed("meth")(scala.Tuple2("value1", 10), scala.Tuple2("value2", 100))
33
possible cause: maybe a wrong Dynamic method signature?
4-
d.meth(value1 = 10, value2 = 100) // two arguments here, but only one is allowed
4+
d.meth(value1 = 10, value2 = 100) // error: two arguments here, but only one is allowed
55
^
66
one error found

tests/untried/neg/t8006.scala renamed to tests/neg/t8006.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object X {
22
val d = new D
3-
d.meth(value1 = 10, value2 = 100) // two arguments here, but only one is allowed
3+
d.meth(value1 = 10, value2 = 100) // error: two arguments here, but only one is allowed
44
}
55
import language.dynamics
66
class D extends Dynamic {
File renamed without changes.
File renamed without changes.

tests/pending/run/t4536.scala renamed to tests/run/t4536.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
2-
3-
4-
5-
1+
import scala.language.dynamics
62

73
object dynamicObject extends Dynamic {
84
def applyDynamic(m: String)() = println("obj: " + m);
@@ -38,7 +34,7 @@ object dynamicMixin extends dynamicAbstractClass with dynamicTrait {
3834

3935
object Test {
4036

41-
def main(args: Array[String]) {
37+
def main(args: Array[String]) = {
4238
val cls = new dynamicClass
4339
dynamicMixin
4440
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)