Abel Nieto

Results 12 comments of Abel Nieto

1. Pattern matching already works. 2. Thanks for the suggestions. We're still deciding how general the flow sensitivity will be.

Implemented the following algorithm in https://github.com/abeln/dotty/commit/740790e2d21c251980ea3acf167f4db53ba2e801 Let `NN(cond, true/false)` be the set of `TermRefs` that we can infer to be non-null in `cond` if `cond` is true/false, respectively. Then define...

We can type all of https://github.com/abeln/dotty/blob/explicit-null/tests/pos/explicit-null-flow.scala We still need to propagate the new type information _inside_ the conditional: ``` val x: String|Null = ??? if (x != null && x.length...

Another TODO: support for the feature in TASTy.

> We still need to propagate the new type information inside the conditional: This is now done in https://github.com/abeln/dotty/commit/74039292ea9e10fbc23639ffcf5afee00585adf6 So we can now additionally support ``` val x: String|Null =...

https://github.com/abeln/dotty/issues/7#issuecomment-445057335 is still a TODO. Another TODO: make sure that the error message mentions the refined type and not the symbol type. e.g. ``` 2 class Foo { 3 class...

Algorithm for propagating nullability inside a condition: ``` When typing `A && B` - type `A` - compute NN(A) - type B in the context augmented with NN(A, true) Similarly,...

We now also support inference within blocks. See https://github.com/abeln/explicit-null-docs/blob/master/migration.md#non-local-control-flow-and-blocks for details. This allows to handle cases like ```scala def foo(x: String|Null): String = { if (x == null) return ""...

@olhotak do you remember what we agreed for this one?

This should be fixed when we port the standard library, but the more general solution will require binary compatibility.