Null object: Difference between revisions

Content added Content deleted
Line 750: Line 750:
}
}


// if (String test ?= s){} // <-- compiler error: The expression type is not nullable: "String"
// if (String test ?= s){} // <-- compiler error: The expression type is not nullable
s2 = s; // at this point, s is known to be a non-null String
s2 = s; // at this point, s is known to be a non-null String
console.print($"{s=}, {s2=}, {s==s2=}");
console.print($"{s=}, {s2=}, {s==s2=}");