Skip to content

Tighten condition when to check enum constructors #11098

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

Merged
merged 3 commits into from
Jan 13, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 13, 2021

Fixes #11081

@bishabosha
Copy link
Member

there should also be a change to def isCase on line 1223 to prevent the following:

enum Outer:
  case Foo(u: Unavailable) // ok
  case Bar(u: DefinitelyNotAvailable) // error
object Outer:
  case class Unavailable(i: Int)
  class DefinitelyNotAvailable

@bishabosha bishabosha self-requested a review January 13, 2021 18:13
Copy link
Member

@bishabosha bishabosha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@odersky odersky merged commit 8cddc66 into scala:master Jan 13, 2021
@odersky odersky deleted the fix-#11081 branch January 13, 2021 18:59
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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

Successfully merging this pull request may close these issues.

Incorrect "Illegal reference to type from enum case" in companion object
3 participants