nil checking

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Re: nil checking

Postby nerdzero » Sun Jan 13, 2013 4:25 pm

Charles wrote:...
if true
foo = Foo()

The correct behavior should be an inferred type of Foo (non-nilable) and an error that it was used uninitialized.

It should be an error if you try to use a non-nilable reference variable that might not be initialized.

Maybe it should also be an error for value variables as well. That's debatable.

I don't want to change the inference to nilable because I would just end up changing it back when the code flow analysis and error checking improved.

Fair enough. I'll shut up now :)
Posts: 286
Location: Chicago, IL


Return to Discussion

Who is online

Users browsing this forum: No registered users and 6 guests