robin
02/10/2017, 3:06 PMgetText
method is annotated with @NotNull
, while the parameter to the setText
Method isn't? In that case, the synthetic property text
seems to have it's type inferred from the getter method and just assumes that the setter should follow the same rule. If you manually create a nullable setter and a not nullable getter via annotations from java, the text
property is actually assumed to be a val
, as the two methods have different types, as far as kotlin is concerned.