diff options
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/neg/scopes.check | 19 | ||||
-rw-r--r-- | test/pending/neg/scopes.scala | 14 |
2 files changed, 33 insertions, 0 deletions
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 +} |