Skip to content

Add specific parse errors for angle-bracket generics #4818

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AaronC81
Copy link

This PR adds specific parse errors for these cases, where a developer new to Gleam (i.e. me!) tries to write generic functions or types using angle brackets:

fn something<T>(x: T) { ... }

let x: List<String> = []

type Maybe<String> { ... }

See the snapshots for examples of the concrete errors.

First PR, so any stylistic comments are welcome :)
Thanks for the great contributing documentation, it was very easy to get started.

Closes #4816.

@AaronC81
Copy link
Author

Should I add a CHANGELOG entry for this change?
I can see some PRs add one, but not all, and I couldn't spot any docs on which kinds of changes need an entry.

If there should be one, let me know and I'm happy to update the PR

@GearsDatapacks
Copy link
Member

Yes, you'll need to add a changelog entry. Since we're in the release candidate phase for 1.12, this won't be merged until after 1.12 is out.
You'll need to add a new "Unreleased" section at the top of the file (h2) and then add a "Compiler" section below that (h3). Then you can look at existing changelog entries for an idea of what to write

@AaronC81
Copy link
Author

AaronC81 commented Aug 1, 2025

@GearsDatapacks - Great, thanks - added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specific parser error for angle-bracket generics
2 participants