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

Match on Nothing doesn't -Ycheck #5073

Closed
OlivierBlanvillain opened this issue Sep 3, 2018 · 2 comments
Closed

Match on Nothing doesn't -Ycheck #5073

OlivierBlanvillain opened this issue Sep 3, 2018 · 2 comments
Assignees

Comments

@OlivierBlanvillain
Copy link
Contributor

??? match {
  case Some(_) => ()
}
*** error while checking /home/olivier/workspace/dotty/tests/pos/annot-2.scala after phase splitter ***
exception occurred while compiling /home/olivier/workspace/dotty/tests/pos/annot-2.scala                                   Exception in thread "main" java.lang.AssertionError: assertion failed: symbols differ for x1.ne
was                 : method ne                                        
alternatives by type:  of types                                                               
qualifier type      : => Nothing(???)(x1)                                    
tree type           : ((x$0: Object): Boolean)(x1.ne) of class class dotty.tools.dotc.core.Types$CachedTermRef

scalac rejects that code in typer:

scala> ??? match {
     |   case Some(_) => ()
     | }
<console>:13: error: constructor cannot be instantiated to expected type;
 found   : Some[A]
 required: Nothing
         case Some(_) => ()
              ^
OlivierBlanvillain added a commit to dotty-staging/dotty that referenced this issue Sep 3, 2018
Move pickling/annot.scala to pending as it doesn't pass Ycheck,
see scala#5073.
@abeln
Copy link
Contributor

abeln commented Sep 3, 2018

Duplicate of #5067

@abeln abeln marked this as a duplicate of #5067 Sep 3, 2018
@allanrenucci
Copy link
Contributor

Thanks @abeln

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants