abeln / dotty

Scala with explicit nulls
https://github.com/abeln/dotty/wiki/scala-with-explicit-nulls
Other
23 stars 2 forks source link

Ignore nullability during override checks #12

Closed abeln closed 6 years ago

abeln commented 6 years ago

We should be able to extend the Java class

abstract class J {
  String foo(String x)
}

with the Scala class

class S extends J {
  override def foo(x: String): String = ???
}

Notice that the method in J has type String|Null => String|Null and the one in S is String => String. But we're considering allowing the (unsound) override to go through for easier interop.

abeln commented 6 years ago

https://github.com/abeln/dotty/commit/2ac3fffcd224552754b1319a806baf4741e042e2 is a first fix, but https://github.com/abeln/dotty/blob/explicit-null/tests/pos/t5703/Impl.scala is still failing

abeln commented 6 years ago

Fixed in https://github.com/abeln/dotty/commit/9aae897be2eeae05a77cefc0565ce61b13012374