-
Notifications
You must be signed in to change notification settings - Fork 1.1k
inner class of enum companion not visible from the enum, unless companion is declared after #13554
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
Comments
thanks for the more concise naming @bishabosha, glad that it got some attention. |
minimised to just an inner class causing the issue: object StatusCode:
class Matcher
enum StatusCode(m: StatusCode.Matcher):
case InternalServerError extends StatusCode(???) again it is fixed by changing the order: enum StatusCode(m: StatusCode.Matcher):
case InternalServerError extends StatusCode(???)
object StatusCode:
class Matcher |
I traced it to this line (not the root cause):
|
Yes, that describes the symptom, but not the cause. |
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.0.2 and 3.1.0-RC2
Minimized code
Output
Expectation
When putting the object declaration after the enum declaration it does compile, like so
Which is really frustrating.
The text was updated successfully, but these errors were encountered: