-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parser: Enable late typing of composite literals #174
Conversation
f88ee85
to
9d32dd4
Compare
firebase-deployment: https://evy-lang--174-goi2atcg.web.app (e603b1d) |
9d32dd4
to
077e90f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥦 This is ok for now, but for me the code in type.go with Accept, Matches, acceptLiteral and acceptStrict has gotten to the point where I can't make a lot of sense of it any more. I think it all needs some thought about unifying parts of it where possible. It logically seems sensible that Accept()
would be at least partially implemented by calling Matches()
and there perhaps should be just a few additional cases to deal with literal conversion and generic collections.
But I don't have the mental bandwidth this Saturday morning to figure this out. If you don't get around to merging this right away I might give some thought to that unification.
Enable late typing of composite literals, such that [1] can be ` []num` or an `[]any` depending on what is required by the assigned variable, parameter or return type. This finally allows for an evy implementation of a function like `font` which accepts and `{}any` to call as: `font {size: 4}`.
077e90f
to
e603b1d
Compare
Yeah, I sadly have to totally agree. Barnacles. I leave the PR open for now. |
Thinking about this in the context of the panic of assigning a different type to an element of an |
Well, something's broken, I'd agree there. FWIW
also panics, even though it gets assigned an []any array - something more fundamentally is broken here. I will wait for the other fix before merging this maybe. |
This is also broken:
|
This comment should be addressed here I think: |
#206 is covering this now. |
Enable late typing of composite literals, such that
[1]
can be[]num
or an[]any
depending on what is required by the assignedvariable, parameter or return type.
This finally allows for an evy implementation of a function like
font
which accepts and
{}any
to call as:font {size: 4}
.