September 27, 2009Re: Null references redux
Posted in reply to Walter Bright
Hello Walter, > The problem with non-nullable references is what do they default to? > Some "nan" object? When you use a "nan" object, what should it do? > Throw an exception? > They don't have a default. There semantics would be such that the compiler rejects as illegal any code that would require it to supply a default. As to the user stuffing "c_empty" in just to get the compiler to shut up; firstly, that says the variable should not yet be declared as you don't yet known what value to give it and secondly either c_empy is a rational value or the user is subverting the type system and is on there own.