Possibly spurious warning on type test
See original GitHub issueCompiler version
3.0.0
Minimized code
sealed trait Action[Page]
case class Renderer[Page, Props]() extends Action[Page]
sealed trait Redirect[Page] extends Action[Page]
final class RouterLogic[Page, Props] {
def hmm1(a: Action[Page]): Int =
a match {
case r: Renderer[Page, Props] => 1
case _ => 2
}
def hmm2(a: Action[Page]): Int =
a match {
case r: Redirect[Page] => 2
case _ => 1
}
}
Output
[warn] 9 | case r: Renderer[Page, Props] => 1
[warn] | ^^^^^^^^^^^^^^^^^^^^^^^^
[warn] | the type test for Renderer[Page, Props] cannot be checked at runtime
[warn] one warning found
Expectation
No warnings. (Scala 2.13.6 emits no warnings.)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Warning: Possibly spurious solutions. [solvelib::checkSolutions]
I am trying to solve four algebraic equations in a for loop. It is giving a warning 'Possibly spurious solutions ...
Read more >86647 – Test on constant expression (unsigned) -Wtype-limits warning
The consequence of this bug is that the following macro used to detect signed integer types #define SIGNED(T) ((T) -1 < 0) triggers...
Read more >Common issues and solutions - mypy 0.991 documentation
Spurious errors and locally silencing the checker You can add a # type: ignore comment to tell mypy to ignore this error: import...
Read more >solve function solution issues: spurious solutions - MathWorks
Warning : Possibly spurious solutions. > In symengine. In mupadengine/evalin (line 123). In mupadengine/feval (line 182). In solve (line 293).
Read more >Spurious Regression - RATS 10.0
2 or even lower. The Engle-Granger test (@EGTEST) tests for cointegration by running a (potentially) spurious regression and testing the residuals for a...
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 Free
Top 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
Scala 2 has received a bunch of improvements around pattern checks. This will be on the top of pile where someone might notice it.
Fantastic! Very glad to hear that Scala 2 will keep getting love and care for a while yet 😁