There's a problem in early SDK 7.4.* versions (that have been pulled back) and in SDK 8.0.0 beta with enabled strict type checking:
import Toybox.Lang; function f(x as Number) as Number? { // Object of type 'PolyType<Any or $.Toybox.Lang.Number>' does not match return type 'PolyType<Null or $.Toybox.Lang.Number>'. return x != null ? x : null; }
Such code builds without errors in 7.3.1 and 7.4.3.