wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
554 stars 332 forks source link

Expression 2: function predefinition is broken #2910

Closed stepa2 closed 11 months ago

stepa2 commented 11 months ago

Following code does not compile.

@strict
function b() { error("undef") }

function a() { b() }
function b() { a() }

No workarounds that keep type checking of argument and return value.

Vurv78 commented 11 months ago

It shouldn't compile. Function overriding isn't a thing anymore on @strict. It's a hacky weird dynamic behavior. If you want it, use lambdas.

Vurv78 commented 11 months ago

Closing as I never guaranteed backwards compatibility with @strict (only for very widely used / common programming stuff)