This was discussed a couple of weeks ago, and I've run into it a couple times now. Sometimes in an it-block constructor you want to check if a field has been assigned yet to determine if you should do a default assignment. For example:
new make(|This| f)
{
f(this)
if (dir != null) dir = ...
}
const File dir
Since we don't allow you compare non-nullable field to null this was sort of awkward. What I decided to do is to disable non-nullable comparison errors if:
brian Thu 17 Mar 2011
This was discussed a couple of weeks ago, and I've run into it a couple times now. Sometimes in an it-block constructor you want to check if a field has been assigned yet to determine if you should do a default assignment. For example:
Since we don't allow you compare non-nullable field to null this was sort of awkward. What I decided to do is to disable non-nullable comparison errors if:
this
changeset