[68793 Closed] New language feature in 8.0: non-nullable types


(marc hoffman) #1

Guys,

As you may have seen, the latest Fire beta has a alpha build of the new version 8.0 compiler, played for release late this year (while the regular Elements beta testers are still on 7.1).

One of the new features in that compiler (currently the only one), is our new support for non-nullable reference types, in all three languages. You can check out more on this on the wiki page below:

http://www.elementswiki.com/en/Not_Nullable_Types

This feature is still in its early stages, but testing and feedback would be appreciated.


(JohnMoshakis) #2

Will it work with properties ?

Employee = public class
  public
    property Name: not nullable String;
  end;

Currently the compiler doesn’t complain until I try and assign nil

new Employee in code works but Name is nil

It would be really cool if I got a compiler error if I didn’t assign a value in the constructor or when I’m constructing it i.e

stuff := new Employee ( Name := ‘Frank’)


(marc hoffman) #3

That’s the plan, yes. If that doesn’t happen, thats either a bug, or a part that isn’t implemented yet. will log.


(RemObjects) #4

Thanks, logged as bugs://68793: non-null type don’t get enforced on property decl w/o initialization


(RemObjects) #5

bugs://68793 got closed as fixed for release Constitution Class