From db99926628a2b636a548049c1204fee78c77b9bb Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 3 Aug 2010 20:03:08 +0000 Subject: added @deprecatedName annotation, allowing to d... added @deprecatedName annotation, allowing to deprecate parameter names. review by prokopec. --- test/files/run/names-defaults.check | 3 +++ test/files/run/names-defaults.scala | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'test/files/run') 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) -- cgit v1.2.3