Skip to content

Commit

Permalink
new error message for not hot fields
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelchassot authored and vkuncak committed Apr 30, 2024
1 parent 9695ea7 commit 73c4be4
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
[ Error ] Initialization5.scala:6:17: Cannot prove the method argument is hot. Only hot values are safe to leak.
[ Error ] Found = ThisRef[class NoThis].
[ Error ] Non initialized field(s): value nothis1, value nothis2. Calling trace:
[ Error ] -> case class NoThis() { [ Initialization5.scala:2 ]
[ Error ] ^
[ Error ] -> val nothis1 = f() [ Initialization5.scala:3 ]
[ Error ] ^^^
[ Error ] -> def f() = g(this) [ Initialization5.scala:6 ]
[ Error ] ^^^^
[ Error ]
def f() = g(this)
^
[ Error ] Initialization5.scala:3:9: Not well formed definition @field
[ Error ] @fieldDefPosition(8)
[ Error ] @method(NoThis)
[ Error ] def nothis1: Int = this.f
[ Error ] because field `nothis1` can only refer to previous fields, not to `nothis2`
val nothis1 = f()
^

0 comments on commit 73c4be4

Please sign in to comment.