dotty icon indicating copy to clipboard operation
dotty copied to clipboard

Scala with explicit nulls

Results 14 dotty issues
Sort by recently updated
recently updated
newest added

As per our last meeting, we need to support the following kinds of idioms: (easier) ``` // s: String|Null if (s != null) { // s: String } ``` and...

explicit-null

```scala 1 class Foo { 2 val s: String = ??? 3 s match { 4 case x: String => 1 5 // Test that this isn't marked as unreachable...

The pattern matcher can't distinguish between ``` ??? match { case a: Array[String|Null] => ??? case a: Array[String] => ??? } ``` Should we warn the user when they try...

explicit-null

If we have Java code ``` class Foo { public static void foo(T[] arr) {} } ``` we can no longer call it from Scala with an argument that's an...

explicit-null

Recognize the @NonNull annotation (in its multiple forms) in the Java interop layer, so we can do a more precise translation of types coming from Java.

explicit-null

Liftable.scala has a bunch of liftable instances for primitive types, including String (not shown below): ``` object Liftable { implicit def BooleanIsLiftable: Liftable[Boolean] = new Liftable[Boolean] { def toExpr(x: Boolean):...

explicit-null

Smaller repro of the failure: ``` class Foo extends scala.util.control.NoStackTrace { } ``` The problem is that https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#fillInStackTrace() returns a `Throwable|JavaNull`, but since the standard library is non-boostrapped, there's no...

explicit-null

This doesn't typecheck ``` object Test { def main(args: Array[String]): Unit = { val f = new Foo println(1) println(f.foo) println(2) println(f.foo) // TODO: Erase // Currently not erasing fields...

explicit-null

Consider what, if any, changes are required to `CheckRealizable` in light of this comment ``` // check fields only under strict mode for now. // Reason: An embedded field could...

explicit-null