aboutsummaryrefslogtreecommitdiff
path: root/tests/repl
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-02-05 13:28:11 +0100
committerGuillaume Martres <smarter@ubuntu.com>2017-02-05 17:50:09 +0100
commitb0576e977c26a86a400755ab9810b90af73b3b8d (patch)
tree1b0557b13cd7bd398d0ff385283bcb575cbc2fd7 /tests/repl
parentac868319ecf75bcffe6000a41379c5c12e92e62e (diff)
downloaddotty-b0576e977c26a86a400755ab9810b90af73b3b8d.tar.gz
dotty-b0576e977c26a86a400755ab9810b90af73b3b8d.tar.bz2
dotty-b0576e977c26a86a400755ab9810b90af73b3b8d.zip
Better positions for infix term operations.
Preserving the position of infix operators is useful for IDEs' type-at-point. We also preserve the position of the untyped lhs of right-associative operators, this is useful both for IDEs and for error messages, before: 4 |val x: List[Int] = "foo" :: List(1) | ^ | found: String($1$) | required: Int | After: scala> val x: List[Int] = "foo" :: List(1) -- [E007] Type Mismatch Error: <console> --------------------------------------- 4 |val x: List[Int] = "foo" :: List(1) | ^^^^^ | found: String($1$) | required: Int | Note: It would be even nicer if we displayed "String" instead of "String($1$)" since $1$ is synthetic, this commit does not address this.
Diffstat (limited to 'tests/repl')
-rw-r--r--tests/repl/errmsgs.check7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/repl/errmsgs.check b/tests/repl/errmsgs.check
index f0ccdf53f..0dc8e8ae5 100644
--- a/tests/repl/errmsgs.check
+++ b/tests/repl/errmsgs.check
@@ -78,4 +78,11 @@ scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
4 |class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
| ^^^^^^^^
| value `barr` is not a member of Foo(foo) - did you mean `foo.bar`?
+scala> val x: List[Int] = "foo" :: List(1)
+-- [E007] Type Mismatch Error: <console> ---------------------------------------
+4 |val x: List[Int] = "foo" :: List(1)
+ | ^^^^^
+ | found: String($1$)
+ | required: Int
+ |
scala> :quit