close
Skip to content

fix(compiler): Correct type printing of type A<a> = a#2302

Merged
ospencer merged 1 commit into
grain-lang:mainfrom
spotandjake:spotandjake-oprint-var
Jun 30, 2025
Merged

fix(compiler): Correct type printing of type A<a> = a#2302
ospencer merged 1 commit into
grain-lang:mainfrom
spotandjake:spotandjake-oprint-var

Conversation

@spotandjake
Copy link
Copy Markdown
Member

@spotandjake spotandjake commented Jun 29, 2025

Previously if you had the line type A<a> = a it would cause the lsp to crash as we didn't handle the case of = a in oprint, this corrects the implementation to prevent the crash.

I am slightly wondering if we should even allow this behaviour. I came across this behaviour with low level grain bassically taking advantage of it to create a completely abstract type and am only submitting a fix because nothing prevents a user from doing it currently however I don't really see any real world use case for this syntax.

Copy link
Copy Markdown
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful, like you said, for abstract types.

@ospencer ospencer added this pull request to the merge queue Jun 30, 2025
Merged via the queue into grain-lang:main with commit ac892d1 Jun 30, 2025
12 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants