Skip to content

Commit

Permalink
Change error message text from "fully-initialized" to "fully initiali…
Browse files Browse the repository at this point in the history
…zed"

- Remove hyphen from error message (as mentioned [here](scala#14292 (comment)))

Signed the CLA - @Xavientois

Review by @liufengyun
  • Loading branch information
Xavientois committed Feb 2, 2022
1 parent 195e887 commit 6fc2e3d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Expand Up @@ -1042,7 +1042,7 @@ object Semantic {

/** Utility definition used for better error-reporting of argument errors */
case class ArgInfo(value: Value, source: Tree) {
def promote: Contextual[List[Error]] = value.promote("May only use initialized value as arguments", source)
def promote: Contextual[List[Error]] = value.promote("Only initialized values may be used as arguments", source)
}

/** Evaluate an expression with the given value for `this` in a given class `klass`
Expand Down
6 changes: 3 additions & 3 deletions tests/init/neg/closureLeak.check
@@ -1,7 +1,7 @@
-- Error: tests/init/neg/closureLeak.scala:11:14 -----------------------------------------------------------------------
11 | l.foreach(a => a.addX(this)) // error
| ^^^^^^^^^^^^^^^^^
| Cannot prove that the value is fully initialized. May only use initialized value as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Cannot prove that the value is fully initialized. May only use initialized value as arguments.
| The unsafe promotion may cause the following problem:
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
4 changes: 2 additions & 2 deletions tests/init/neg/default-this.check
@@ -1,5 +1,5 @@
-- Error: tests/init/neg/default-this.scala:9:8 ------------------------------------------------------------------------
9 | compare() // error
| ^^^^^^^
| Cannot prove that the value is fully initialized. May only use initialized value as arguments. Calling trace:
| -> val result = updateThenCompare(5) [ default-this.scala:11 ]
|Cannot prove that the value is fully initialized. Only initialized values may be used as arguments. Calling trace:
| -> val result = updateThenCompare(5) [ default-this.scala:11 ]
4 changes: 2 additions & 2 deletions tests/init/neg/promotion-loop.check
@@ -1,7 +1,7 @@
-- Error: tests/init/neg/promotion-loop.scala:16:10 --------------------------------------------------------------------
16 | println(b) // error
| ^
| Cannot prove that the value is fully initialized. May only use initialized value as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Cannot prove that the value is fully initialized. May only use initialized value as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
4 changes: 2 additions & 2 deletions tests/init/neg/t3273.check
@@ -1,15 +1,15 @@
-- Error: tests/init/neg/t3273.scala:4:42 ------------------------------------------------------------------------------
4 | val num1: LazyList[Int] = 1 #:: num1.map(_ + 1) // error
| ^^^^^^^^^^^^^^^
| Cannot prove that the value is fully initialized. May only use initialized value as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Access non-initialized value num1. Calling trace:
| -> val num1: LazyList[Int] = 1 #:: num1.map(_ + 1) // error [ t3273.scala:4 ]
-- Error: tests/init/neg/t3273.scala:5:61 ------------------------------------------------------------------------------
5 | val num2: LazyList[Int] = 1 #:: num2.iterator.map(_ + 1).to(LazyList) // error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Cannot prove that the value is fully initialized. May only use initialized value as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Access non-initialized value num2. Calling trace:
Expand Down

0 comments on commit 6fc2e3d

Please sign in to comment.