Open stevemeacham opened 4 years ago
A bit of poking and I think the problem is the interaction between the built in suffix function :ADD()
and the @
as this code also throws the same error
LOCAL munLatLng IS MUN:GEOPOSITIONLATLNG@.
PRINT munLatLng(0,0).
where as trying the same thing with a lexicon
LOCAL l IS LEX("a",{PARAMETER a. RETURN a.}).
LOCAL la is l:a@.
PRINT la("a").
works just fine.
So a temporary work around would be to wrap the suffix function in your own function.
Great detective work! Thank you.
The workaround works, of course, but is too verbose for me to use in this instance. I'll just call Lexicon:ADD()
directly in the four places I was using the delegate.
I can use functional programming techniques with delegates, closures, and so on, in so many ways, I can't complain that one minor use case doesn't work and has workarounds.
@stevemeacham Thank you for reporting this. @nuggreat Thanks for diagnosing this and reducing it to a minimal example.
I'm going to change the title to something that makes it easier for me to see what it's about when I see it in the issue list.
Internal Error. Contact the kOS developers with the phrase 'impossible FromPrimitiveWithAssert(kOS.Safe.Encapsulation.Suffixes.DelegateSuffixResult) was attempted'.
I would provide output.log if I knew where it is. There was a stderr.log created in KSP_ROOT at or about the time this happened, but it is zero bytes.
Here is the Kerboscript code that produced this. It's the PARAMETER statement for an anonymous function:
Here is the offending source file. It was already "compressed" when it was being run, so you get to see the ugly but compact version: