Skip to content

Implement let assert ... as syntax #3807

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

Merged
merged 8 commits into from
Nov 25, 2024
Merged

Conversation

GearsDatapacks
Copy link
Member

Closes #3216
This PR adds the option to add a custom panic message when using let assert.

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you!!

pub fn expect(value, message) {
let inner = case value {
Ok(inner) -> inner
_ -> panic as message
Copy link
Member

Choose a reason for hiding this comment

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

Oh that is super nice

@lpil lpil merged commit d294cf0 into gleam-lang:main Nov 25, 2024
12 checks passed
@GearsDatapacks GearsDatapacks deleted the let-assert-as branch November 25, 2024 14:26
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.

Add let assert ... as syntax
2 participants