Implementing Null Safety in Ceylon with Flow-Sensitive Typing
Learn how to use Ceylon's nullable types and the exists guard to eliminate NullPointerExceptions through compile-time type narrowing.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to use Ceylon's nullable types and the exists guard to eliminate NullPointerExceptions through compile-time type narrowing.
Narrowing not applied in the else branch I have a Ceylon function whose parameter has the union type String|Integer . My understanding of the language specification is that flow-sensitive typing should narrow the value inside an if (is String val) branch to String , and in the else branch to the complement type (here, Integer ). I am trying to rely on that c