-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unreachable case in TypeTest #18052
Labels
Comments
bblfish
added
itype:bug
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Jun 24, 2023
odersky
added
area:pattern-matching
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Jun 24, 2023
Interestingly the above code worked in release 3.0 $ scala-cli compile -j 17 -S 3.0 scala
Downloading Scala 3.0.2 compiler
Compiling project (Scala 3.0.2, JVM)
Compiled project (Scala 3.0.2, JVM) It worked in release 3.1 $ scala-cli compile -j 17 -S 3.1 scala
Downloading Scala 3.1.3 compiler
Compiling project (Scala 3.1.3, JVM)
Compiled project (Scala 3.1.3, JVM) and in 3.2 scala-cli compile -j 17 -S 3.2 scala
Compiling project (Scala 3.2.2, JVM)
Compiled project (Scala 3.2.2, JVM) and in scala-cli compile -j 17 -S 3.3 scala
Compiling project (Scala 3.3.0, JVM)
Compiled project (Scala 3.3.0, JVM) but not in the nightly scala-cli compile -j 17 -S 3.nightly scala
Downloading Scala 3.3.2-RC1-bin-20230714-04eae14-NIGHTLY compiler
Compiling project (Scala 3.3.2-RC1-bin-20230714-04eae14-NIGHTLY, JVM)
[warn] ./scala/RDF.scala:63:17
[warn] Unreachable case except for null (if this is intentional, consider writing case null => instead).
[warn] case _ => None
[warn] ^
Compiled project (Scala 3.3.2-RC1-bin-20230714-04eae14-NIGHTLY, JVM) |
Oops. Warning! It looks like this bug has introduced itself into 3.3.1 Release Candidate 4! $ scala-cli compile -j 17 -S "3.3.1-RC4" scala
Compiling project (Scala 3.3.1-RC4, JVM)
[warn] ./scala/RDF.scala:63:17
[warn] Unreachable case except for null (if this is intentional, consider writing case null => instead).
[warn] case _ => None
[warn] ^
Compiled project (Scala 3.3.1-RC4, JVM) |
Peraps the issue is fixed? I don't get an error anymore with either, $ scala-cli compile -j 17 -S 3.3.1-RC6 scala
$ scala-cli compile -j 17 -S 3.nightly scala |
Possibly with #18303. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
Following the fix to issue 16408 I tried to use
Scala 3.3.2-RC1-bin-20230623-171849f-NIGHTLY
in the scala3 version of banana-rdf.
Minimized code
I adapted the longer code from 16408 in the unreachableCase branch RDF.scala and was able to duplicate the warning.
The difference as seen in this commit is just the addition of
BNode
typetype Subject[R <: RDF] = URI[R] | BNode[R]
given subjToURITT: TypeTest[RDF.Subject[R], RDF.URI[R]]
(the implementations are in terms of traits rather than a class, but that makes no difference anymore).
Output
Expectation
There should be no warning on unreachable case there as clearly the BNode case is possible.
The text was updated successfully, but these errors were encountered: