Skip to content

Error Messages: Refactor backticks, capitalize messages #5335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 124 additions & 124 deletions compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion compiler/test-resources/repl/1379
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scala> object Foo { val bar = new Object { def baz = 1 }; bar.baz }
1 | object Foo { val bar = new Object { def baz = 1 }; bar.baz }
| ^^^^^^^
| value `baz` is not a member of Object - did you mean `bar.eq`?
| value baz is not a member of Object - did you mean bar.eq?
44 changes: 22 additions & 22 deletions compiler/test-resources/repl/errmsgs
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,68 @@ scala> class Inv[T](x: T)
scala> val x: List[String] = List(1)
1 | val x: List[String] = List(1)
| ^
| found: Int(1)
| required: String
| Found: Int(1)
| Required: String
scala> val y: List[List[String]] = List(List(1))
1 | val y: List[List[String]] = List(List(1))
| ^
| found: Int(1)
| required: String
| Found: Int(1)
| Required: String
scala> val z: (List[String], List[Int]) = (List(1), List("a"))
1 | val z: (List[String], List[Int]) = (List(1), List("a"))
| ^
| found: Int(1)
| required: String
| Found: Int(1)
| Required: String
1 | val z: (List[String], List[Int]) = (List(1), List("a"))
| ^^^
| found: String("a")
| required: Int
| Found: String("a")
| Required: Int
scala> val a: Inv[String] = new Inv(new Inv(1))
1 | val a: Inv[String] = new Inv(new Inv(1))
| ^^^^^^^^^^
| found: Inv[Int]
| required: String
| Found: Inv[Int]
| Required: String
scala> val b: Inv[String] = new Inv(1)
1 | val b: Inv[String] = new Inv(1)
| ^
| found: Int(1)
| required: String
| Found: Int(1)
| Required: Stri
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed part of String by mistake here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh dang, my bad!

scala> abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
1 | abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
| ^
|found: C.this.T(C.this.x)
|required: T'
|Found: C.this.T(C.this.x)
|Required: T'
|
|where: T is a type in class C
| T' is a type in the initializer of value s which is an alias of String
1 | abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
| ^
|found: T(y)
|required: T'
|Found: T(y)
|Required: T'
|
|where: T is a type in the initializer of value s which is an alias of String
| T' is a type in method f which is an alias of Int
scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
1 | class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
| ^^^^^^^^
| value `barr` is not a member of Foo - did you mean `foo.bar`?
| value barr is not a member of Foo - did you mean foo.bar?
scala> val x: List[Int] = "foo" :: List(1)
1 | val x: List[Int] = "foo" :: List(1)
| ^^^^^
| found: String("foo")
| required: Int
| Found: String("foo")
| Required: Int
scala> { def f: Int = g; val x: Int = 1; def g: Int = 5; }
1 | { def f: Int = g; val x: Int = 1; def g: Int = 5; }
| ^
| `g` is a forward reference extending over the definition of `x`
| g is a forward reference extending over the definition of x
scala> while ((( foo ))) {}
1 | while ((( foo ))) {}
| ^^^
| not found: foo
| Not found: foo
scala> val a: iDontExist = 1
1 | val a: iDontExist = 1
| ^^^^^^^^^^
| not found: type iDontExist
| Not found: type iDontExist
scala> def foo1(x: => Int) = x _
1 | def foo1(x: => Int) = x _
| ^^^
Expand Down
2 changes: 1 addition & 1 deletion compiler/test-resources/repl/errorThenValid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scala> val xs = scala.collection.mutable.ListBuffer[Int]
1 | val xs = scala.collection.mutable.ListBuffer[Int]
| ^
|missing parameter type
|Missing parameter type
|
|The argument types of an anonymous function must be fully known. (SLS 8.5)
|Expected type: ?
Expand Down
6 changes: 3 additions & 3 deletions compiler/test-resources/repl/i2063
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
scala> class Foo extends Bar // with one tab
1 | class Foo extends Bar // with one tab
| ^^^
| not found: type Bar
| Not found: type Bar
scala> class Foo extends Bar // with spaces
1 | class Foo extends Bar // with spaces
| ^^^
| not found: type Bar
| Not found: type Bar
scala> class Foo extends Bar // with tabs
1 | class Foo extends Bar // with tabs
| ^^^
| not found: type Bar
| Not found: type Bar
4 changes: 2 additions & 2 deletions compiler/test-resources/repl/i2213
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
scala> def x
1 | def x
| ^
| missing return type
| Missing return type

scala> def x: Int
1 | def x: Int
| ^
|declaration of method x not allowed here: only classes can have declared but undefined members
|Declaration of method x not allowed here: only classes can have declared but undefined members
8 changes: 4 additions & 4 deletions compiler/test-resources/repl/importFromObj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ scala> import o._
scala> buf += xs
1 | buf += xs
| ^^
| found: List[Int](o.xs)
| required: Int
| Found: List[Int](o.xs)
| Required: Int
scala> buf ++= xs
val res0: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3)
scala> import util.foo
1 | import util.foo
| ^^^
| value `foo` is not a member of util - did you mean `util.Left`?
| value foo is not a member of util - did you mean util.Left?
scala> import util.foo.bar
1 | import util.foo.bar
| ^^^^^^^^
| value `foo` is not a member of util - did you mean `util.Left`?
| value foo is not a member of util - did you mean util.Left?
4 changes: 2 additions & 2 deletions compiler/test-resources/type-printer/type-mismatch
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ val res0: Foo[Int] = Foo(1)
scala> val x: Foo[String] = res0
1 | val x: Foo[String] = res0
| ^^^^
| found: Foo[Int](res0)
| required: Foo[String]
| Found: Foo[Int](res0)
| Required: Foo[String]