You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a simple json parser to learn the language. It seems koka has problems compiling mutually recursive types if one of them is an alias. The following results in a very long compiler error, boiling down to "type jobject not found":
rec type jvalue
Null
True
False
Number(x: float64)
String(x: string)
Array(x: list<jvalue>)
Object(x: jobject)
alias jobject = list<(string, jvalue)>
If I inline jobject into the Object constructor, or define it as
struct jobject
obj: list<(string, jvalue)>
it compiles fine. Is this a compiler bug or a limitation of aliases?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey,
I'm trying to implement a simple json parser to learn the language. It seems koka has problems compiling mutually recursive types if one of them is an alias. The following results in a very long compiler error, boiling down to "type jobject not found":
If I inline
jobject
into theObject
constructor, or define it asit compiles fine. Is this a compiler bug or a limitation of aliases?
Beta Was this translation helpful? Give feedback.
All reactions