Method without result


Oxygene .2275 .NET. Would you consider this to be a compiler bug? It would be useful to trap the omission:

method returnbyte: byte;
b : byte;
b := 5;

There’s no result := b statement, so the method does nothing. Easy to forget when coding.

(marc hoffman) #2

no. result is implicitly preinitialized to default(type). this is valid code and will return 0.