Skip to content
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

Optional error messages for constraints #1082

Closed
lars-reimann opened this issue Apr 22, 2024 · 1 comment · Fixed by #1275
Closed

Optional error messages for constraints #1082

lars-reimann opened this issue Apr 22, 2024 · 1 comment · Fixed by #1275
Assignees
Labels
enhancement 💡 New feature or request released Included in a release

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Apr 22, 2024

Is your feature request related to a problem?

All constraints currently have a standard error message. It would be nice to be able to customize this

Desired solution

New syntax:

... where {
    p > 0 else "Message"
}

The message must evaluate to some constant string if we know parameter values. This would also allow template strings that reference the parameter value.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label Apr 22, 2024
@lars-reimann lars-reimann added this to DSL Apr 22, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DSL Apr 22, 2024
@lars-reimann lars-reimann self-assigned this Apr 25, 2024
@lars-reimann lars-reimann moved this from Backlog to Todo in DSL Apr 25, 2024
@lars-reimann lars-reimann modified the milestones: v0.14.0, v0.15.0 Apr 25, 2024
@lars-reimann lars-reimann removed their assignment May 5, 2024
@lars-reimann lars-reimann removed this from the v0.15.0 milestone May 5, 2024
@lars-reimann lars-reimann moved this from Todo to In Progress in DSL Nov 29, 2024
@lars-reimann lars-reimann self-assigned this Nov 29, 2024
@lars-reimann lars-reimann linked a pull request Nov 29, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to ✔️ Done in DSL Nov 29, 2024
lars-reimann pushed a commit that referenced this issue Jan 4, 2025
## [0.23.0](v0.22.0...v0.23.0) (2025-01-04)

### Features

* categorize API elements ([#1285](#1285)) ([3275900](3275900)), closes [#1243](#1243)
* optional error messages for constraints ([#1275](#1275)) ([fce761c](fce761c)), closes [#1082](#1082)
* prevent editing built-in stubs ([#1282](#1282)) ([d02c30a](d02c30a))
* show placeholders in outline ([#1286](#1286)) ([3880bfe](3880bfe))

### Bug Fixes

* subtype check for literal and union types ([#1288](#1288)) ([911881c](911881c))
* subtype check for literal and union types (part 2) ([#1289](#1289)) ([56284cf](56284cf))
* type inference for lambdas and their parameters ([#1304](#1304)) ([a9e070f](a9e070f))
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request released Included in a release
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

1 participant