From 8de6f6fe13ee02065edc10f54ef643ee36d37153 Mon Sep 17 00:00:00 2001 From: michelou Date: Tue, 12 Dec 2006 17:03:01 +0000 Subject: added test for already defined values --- test/pending/neg/scopes.check | 19 +++++++++++++++++++ test/pending/neg/scopes.scala | 14 ++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/pending/neg/scopes.check create mode 100644 test/pending/neg/scopes.scala (limited to 'test/pending') diff --git a/test/pending/neg/scopes.check b/test/pending/neg/scopes.check new file mode 100644 index 0000000000..2009a438ef --- /dev/null +++ b/test/pending/neg/scopes.check @@ -0,0 +1,19 @@ +scopes.scala:1 error: x is already defined as value x +case class test0(x: int, x: float) + ^ +scopes.scala:5 error: x is already defined as value x + val x: float = .0f + ^ +scopes.scala:8 error: y is already defined as value y + val y: float = .0f + ^ +scopes.scala:11 error: x is already defined in local scope + def params(x: int, x: float) = x + ^ +scopes.scala:11 error: x is already defined in local scope + def curried(x: int)(y: int, y: float) = x + y + ^ +scopes.scala:13 error: x is already defined as value x + (x: int, x: float) => x + ^ +6 errors found diff --git a/test/pending/neg/scopes.scala b/test/pending/neg/scopes.scala new file mode 100644 index 0000000000..0083101b00 --- /dev/null +++ b/test/pending/neg/scopes.scala @@ -0,0 +1,14 @@ +case class test0(x: int, x: float) + +object test1 { + val x: int = 0 + val x: float = .0f + { + val y: int = 0 + val y: float = .0f + () + } + def params(x: int, x: float) = x + def curried(x: int)(y: int, y: float) = x + y + (x: int, x: float) => x +} -- cgit v1.2.3