-
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 #14168: Do not elide fields required for Scala.js interop semanti…
…cs. (#16187)
- Loading branch information
Showing
4 changed files
with
138 additions
and
3 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
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,25 @@ | ||
import scala.compiletime.uninitialized | ||
|
||
object Test: | ||
def main(args: Array[String]): Unit = | ||
val foo = new Foo | ||
assertEquals(0, foo.int) | ||
assertEquals(false, foo.bool) | ||
assertEquals(null, foo.str) | ||
assertEquals((), foo.unit) | ||
assertEquals(ValueClass(0), foo.vc) | ||
end main | ||
|
||
def assertEquals(expected: Any, actual: Any): Unit = | ||
assert(expected == actual) | ||
|
||
class Foo: | ||
var int: Int = uninitialized | ||
var bool: Boolean = uninitialized | ||
var str: String = uninitialized | ||
var unit: Unit = uninitialized | ||
var vc: ValueClass = uninitialized | ||
end Foo | ||
|
||
class ValueClass(val i: Int) extends AnyVal | ||
end Test |
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