diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/names-defaults.check | 3 | ||||
-rw-r--r-- | test/files/run/names-defaults.scala | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check index b4effa26d2..5b271a5d28 100644 --- a/test/files/run/names-defaults.check +++ b/test/files/run/names-defaults.check @@ -106,3 +106,6 @@ blublu1 my text List(1, 2) 3 +1 +2 +3 diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala index 8ddfcd950d..2a50d26cdd 100644 --- a/test/files/run/names-defaults.scala +++ b/test/files/run/names-defaults.scala @@ -350,6 +350,22 @@ object Test extends Application { class DBLAH(val y: String = "2") extends CBLAH() (new DBLAH()) + // deprecated names + def deprNam1(@deprecatedName('x) a: Int, @deprecatedName('y) b: Int) = a + b + deprNam1(y = 10, a = 1) + deprNam1(b = 2, x = 10) + + object deprNam2 { + def f(@deprecatedName('s) x: String) = 1 + def f(s: Object) = 2 + + def g(@deprecatedName('x) s: Object) = 3 + def g(s: String) = 4 + } + println(deprNam2.f(s = "dlf")) + println(deprNam2.f(s = new Object)) + println(deprNam2.g(x = "sljkfd")) + // DEFINITIONS def test1(a: Int, b: String) = println(a +": "+ b) |