added test in neg/scopes.scala

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@9522 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
michelou 2006-12-14 09:56:37 +00:00
parent a0d2429a45
commit e1591709ea
2 changed files with 19 additions and 12 deletions

View File

@ -8,15 +8,18 @@ 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
^
val y: float = .0f
^
scopes.scala:11 error: x is already defined as value x
def params(x: int, x: float) = x
^
def f1(x: int, x: float) = x
^
scopes.scala:12 error: y is already defined as value y
def curried(x: int)(y: int, y: float) = x + y
^
def f2(x: int)(y: int, y: float) = x + y
^
scopes.scala:13 error: x is already defined as value x
(x: int, x: float) => x
^
7 errors found
scopes.scala:15 error: x is already defined as value x
case x::x => x
^
8 errors found

View File

@ -4,11 +4,15 @@ object test1 {
val x: int = 0
val x: float = .0f
{
val y: int = 0
val y: 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
def f1(x: int, x: float) = x
def f2(x: int)(y: int, y: float) = x + y
(x: int, x: float) => x
List() match {
case x::x => x
case Nil => Nil
}
}