Skip to content

feat(compiler): Ignore compiler warnings#2142

Open
alex-snezhko wants to merge 2 commits into
mainfrom
alex/ignore-warnings
Open

feat(compiler): Ignore compiler warnings#2142
alex-snezhko wants to merge 2 commits into
mainfrom
alex/ignore-warnings

Conversation

@alex-snezhko

Copy link
Copy Markdown
Member
match (true) {
  true => void
}
let a = [> 1, 2]
a[1.5]
# will warn
grain compile main.gr
# will not warn
grain compile main.gr --ignore-warnings=all
grain compile main.gr --ignore-warnings=partialMatch,arrayIndexNonInteger

Closes #163

@ospencer

Copy link
Copy Markdown
Member

We discussed this on Discord and decided that for now, we don't want the command line flag. For what's needed for Silo, it just needs to be programmatically configurable, but ideally we'd allow disabling a warning using a comment.

@alex-snezhko

Copy link
Copy Markdown
Member Author

@ospencer do we want comments or attributes for this?

@ospencer

ospencer commented Sep 3, 2024

Copy link
Copy Markdown
Member

Attributes would be a little nicer, but we don't currently support attributes on arbitrary nodes, and that's actually kind of a hard problem. If you want to pair on trying to make that happen we can do that in another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting compiler warnings from flags

3 participants