JoeStrout/miniscript

C# version inappropriately invokes @-referenced method if using dot syntax inside parentheses

JoeStrout opened this issue · 0 comments

An edge case has been found where a function referenced with dot syntax, with invocation suppressed via @, will nonetheless be invoked if you slap parentheses around it. This happens only in the C# version.

]m = {}
]m.r = @rnd
]print @m.r
FUNCTION(seed)
]print (@m.r)
0.865711
]print (@m.r)()
0.716391

Note that the C++ version is fine:

> m = {}
> m.r = @rnd
> print @m.r
FUNCTION(seed)
> print (@m.r)
FUNCTION(seed)
> print (@m.r)()
Compiler Error: got LParen where Comma or EOL is required [line 1]

Also note that the dot syntax appears to required to trigger this bug; a simple reference behaves correctly.

]print (@rnd)
FUNCTION(seed)