m
Anyone?
a
How would the compiler determine whether its safe that
Answer
occurs as a method parameter?
m
Simply by checking types. Unsafe is when method implementation is trying to e.g. set value of that parameter to a private property. The type of setter would be Nothing, which is not assignable from Answer.
See chapter "Detailed design"
b
This probably wouldn't work for interfaces, external classes, and expect classes
m
@benleggiero its true. I couldn't find a way for this to work for overridable declarations. Thats why one of the proposed rules requires such methods to be final.