Prevent Pattern Match Exhaustivity Warning for `transparent`
See original GitHub issueHi, I believe that pattern match exhaustivity warnings should not be emitted for top-level pattern match statements in transparent
methods, given that the pattern match is checked and expanded at compile-time anyway.
I noticed these warnings are emitted when matching over a sealed trait/class in a transparent method body.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How to suppress "match is not exhaustive!" warning in Scala
Here are several options: You can match against Seq instead of List , since Seq doesn't have the exhaustiveness checking (this will fail,...
Read more >No non-exhaustive pattern match warning given for empty ...
I would expect GHC to warn of a non-exhaustive pattern match at compile-time when faced with this,
Read more >Match Exhaustiveness Testing Ignores Guard Statements #5365
For example, the following code will compile without "warning: match is not exhaustive!", even though calling it with a value of 1 will...
Read more >Match may not be exhaustive warning, is this a big deal?
Is there a use case where I should exhaustively pattern match or is it fine to ignore it and use this as an...
Read more >Common Error Messages · OCaml Tutorials
This page gives a list of quick explanations for some error or warning ... OCaml's pattern matching can check whether a set of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That should be addressed by
@implicitNotFound
(not sure Dotty implements it yet but we should). And@compileTimeOnly
is indeed designed for this goal, tho it honestly seems more roundabout.Sorry for the ambiguity, I did mean “I don’t know but we should have it one way or the other”.
This topic came out today on Gitter, and there’s a WIP implementation in #4964 (currently in https://github.com/lampepfl/dotty/pull/4964/commits/2710e2b9165e94d74350ff91d5c1c4f55d01b87b).