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

Is this a bug? Interaction between export and pattern match #7219

Closed
ryanberckmans opened this issue Sep 13, 2019 · 4 comments · Fixed by #7223
Closed

Is this a bug? Interaction between export and pattern match #7219

ryanberckmans opened this issue Sep 13, 2019 · 4 comments · Fixed by #7223

Comments

@ryanberckmans
Copy link

ryanberckmans commented Sep 13, 2019

minimized code

Please see this issue ryanberckmans/noric-bot#1

Minimal repro https://scastie.scala-lang.org/MKy4rSaLSdKhSmuH7uALQA

Screenshot of this issue

image

expectation

No compile warning.

@liufengyun
Copy link
Contributor

Thanks for reporting @ryanberckmans , it looks like to be a bug. It helps a lot if the code can be minimized to a small snippet.

@ryanberckmans
Copy link
Author

I'll work on a minimal repro and update

@ryanberckmans
Copy link
Author

ryanberckmans commented Sep 13, 2019

@liufengyun minimal repro https://scastie.scala-lang.org/MKy4rSaLSdKhSmuH7uALQA

Please note the "Related Issue" in the Scastie snippet. I may have some confusion around the semantics of type X = Foo.X vs export Foo.X.

@liufengyun
Copy link
Contributor

Thanks @ryanberckmans , it helps a lot.

It seems we miss some dealiasing in subtype checking (the same for the problem in your comment):

object Foo {
  enum MyEnum {
    case Red
    case Blue(msg: String)
  }
  export MyEnum._

  val a: Foo.MyEnum.Blue = ???
  a : Foo.Blue   // error:  Found: Foo.MyEnum.Blue(Foo.a), Required: Foo.Blue
}

liufengyun added a commit to dotty-staging/dotty that referenced this issue Sep 13, 2019
@liufengyun liufengyun self-assigned this Sep 13, 2019
odersky pushed a commit to dotty-staging/dotty that referenced this issue Sep 26, 2019
liufengyun added a commit that referenced this issue Sep 26, 2019
Fix #7219: export forwarder should use TypeAlias for parameterless class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants