-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in init checker while compiling scodec-bits community project (…
…#21574) This PR fixes a bug related to heap management in the global initialization checker that occurs when compiling the scodec-bits community project with the -Ysafe-init-global flag. [test_scala2_library_tasty]
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
abstract class A { | ||
def a: Long | ||
} | ||
|
||
object O { | ||
case class B() extends A { | ||
def a = 5L | ||
} | ||
case class C(a2: A) extends A { | ||
var c: Long = a2.a | ||
def a = c | ||
} | ||
def f(a: A): A = C(f(a)) | ||
def g(): A = f(B()) | ||
|
||
val x = g() | ||
} |