-
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
Is this a bug? Interaction between export
and pattern match
#7219
Comments
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. |
I'll work on a minimal repro and update |
@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 |
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
} |
Fix #7219: export forwarder should use TypeAlias for parameterless class
minimized code
Please see this issue ryanberckmans/noric-bot#1
Minimal repro https://scastie.scala-lang.org/MKy4rSaLSdKhSmuH7uALQA
Screenshot of this issue
expectation
No compile warning.
The text was updated successfully, but these errors were encountered: