summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-09-15 23:13:53 +0000
committerPaul Phillips <paulp@improving.org>2010-09-15 23:13:53 +0000
commitb094defe6162232d8be29ae0eb44ab6742c11f9b (patch)
treeff2432ecfb17c84c3bbc1eef116510c2a5b1df64 /test
parentf78d8f648e7c5d4bd0102a03be3e6c8479146e39 (diff)
downloadscala-b094defe6162232d8be29ae0eb44ab6742c11f9b.tar.gz
scala-b094defe6162232d8be29ae0eb44ab6742c11f9b.tar.bz2
scala-b094defe6162232d8be29ae0eb44ab6742c11f9b.zip
positioning fix for infix expressions: report e...
positioning fix for infix expressions: report error at the operator instead of at the receiver of a binop In general use the operator position as the Select position's point instead of the left or right expression. Position.union always uses the receiver's point as point of the result, so swapping fixes that. See http://www.scala-lang.org/node/6912 for the report.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/checksensibleUnit.check4
-rw-r--r--test/files/neg/infix-op-positions.check7
-rw-r--r--test/files/neg/infix-op-positions.scala4
-rw-r--r--test/files/neg/migration28.check4
-rw-r--r--test/files/neg/overload-msg.check2
-rw-r--r--test/files/neg/t1215.check2
-rw-r--r--test/files/neg/t3774.check2
-rw-r--r--test/files/neg/t3776.check2
8 files changed, 19 insertions, 8 deletions
diff --git a/test/files/neg/checksensibleUnit.check b/test/files/neg/checksensibleUnit.check
index 1de1aa8031..7fed4e558a 100644
--- a/test/files/neg/checksensibleUnit.check
+++ b/test/files/neg/checksensibleUnit.check
@@ -1,7 +1,7 @@
checksensibleUnit.scala:3: error: value > is not a member of Unit
println((c = 1) > 0)
- ^
+ ^
checksensibleUnit.scala:4: error: value <= is not a member of Unit
println((c = 1) <= 0)
- ^
+ ^
two errors found
diff --git a/test/files/neg/infix-op-positions.check b/test/files/neg/infix-op-positions.check
new file mode 100644
index 0000000000..1bff9b941a
--- /dev/null
+++ b/test/files/neg/infix-op-positions.check
@@ -0,0 +1,7 @@
+infix-op-positions.scala:2: error: value -! is not a member of Option[Int]
+ Option(1) -! "test" // left associative operator
+ ^
+infix-op-positions.scala:3: error: value -!: is not a member of Option[Int]
+ "test" -!: Option(1) // right associative operators
+ ^
+two errors found
diff --git a/test/files/neg/infix-op-positions.scala b/test/files/neg/infix-op-positions.scala
new file mode 100644
index 0000000000..16351b0ab3
--- /dev/null
+++ b/test/files/neg/infix-op-positions.scala
@@ -0,0 +1,4 @@
+object Test {
+ Option(1) -! "test" // left associative operator
+ "test" -!: Option(1) // right associative operators
+}
diff --git a/test/files/neg/migration28.check b/test/files/neg/migration28.check
index 4c8c58e0fd..4324cc0d0a 100644
--- a/test/files/neg/migration28.check
+++ b/test/files/neg/migration28.check
@@ -1,8 +1,8 @@
migration28.scala:5: error: method ++= in class Stack is deprecated: use pushAll
s ++= List(1,2,3)
- ^
+ ^
migration28.scala:7: error: method foreach in class Stack has changed semantics:
Stack iterator and foreach now traverse in FIFO order.
s foreach (_ => ())
- ^
+ ^
two errors found
diff --git a/test/files/neg/overload-msg.check b/test/files/neg/overload-msg.check
index 780830bff9..4562c9ec65 100644
--- a/test/files/neg/overload-msg.check
+++ b/test/files/neg/overload-msg.check
@@ -9,5 +9,5 @@ overload-msg.scala:3: error: overloaded method value + with alternatives:
(java.lang.String)java.lang.String
cannot be applied to (Int(in method f))
def f[Int](y: Int) = x + y
- ^
+ ^
one error found
diff --git a/test/files/neg/t1215.check b/test/files/neg/t1215.check
index 77a9304b48..1f9dd6bf38 100644
--- a/test/files/neg/t1215.check
+++ b/test/files/neg/t1215.check
@@ -1,4 +1,4 @@
t1215.scala:2: error: value += is not a member of Int
val x = 1 += 1
- ^
+ ^
one error found
diff --git a/test/files/neg/t3774.check b/test/files/neg/t3774.check
index d73166bff9..59c63c4ee8 100644
--- a/test/files/neg/t3774.check
+++ b/test/files/neg/t3774.check
@@ -3,5 +3,5 @@ t3774.scala:4: error: overloaded method value ++ with alternatives:
[B >: ((Int, Int), List[Int]),That](that: scala.collection.TraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Map[(Int, Int),List[Int]],B,That])That
cannot be applied to (scala.collection.immutable.IndexedSeq[((Int, Int), scala.collection.immutable.Range.Inclusive)])
Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)})
- ^
+ ^
one error found
diff --git a/test/files/neg/t3776.check b/test/files/neg/t3776.check
index e8798df6f3..4a5284cf0f 100644
--- a/test/files/neg/t3776.check
+++ b/test/files/neg/t3776.check
@@ -1,4 +1,4 @@
t3776.scala:8: error: value someOperation is not a member of _$1
def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v
- ^
+ ^
one error found