Enforcing return value types
# Lars T Hansen (18 years ago)
I'm guessing you're just experiencing the effects of bugs.ecmascript.org/ticket/285. The correct behavior is a run-time error in standard mode; compile-time error in strict mode.
# Nathan de Vries (18 years ago)
On Mon, 2007-11-12 at 23:50 -0800, Lars T Hansen wrote:
I'm guessing you're just experiencing the effects of bugs.ecmascript.org/ticket/285. The correct behavior is a run-time error in standard mode; compile-time error in strict mode.
Ah, so it is. I'll assume the implementers will know that the scope of the ticket is greater than that of functions with void return value types defined.
,
-- Nathan de Vries
What's the expected behaviour for a function returning a value, of which the type is contrary to the type defined in the function declaration?
For example:
Is this expected behaviour? Here's some similar Actionscript 3 code:
...which produces the following compile-time error:
,
-- Nathan de Vries
PS: Fantastic work with the Linux build of the reference implementation. I'm working my way through the overview documentation, and will probably have a poke at the SML when I'm feeling more game :).