-
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
inlined given resulting in runtime error java.lang.NoSuchFieldError: $outer #13334
Comments
Compiling with
|
Minimizedclass Bar
inline def bar(i: Int): Bar =
new Bar:
def j = i
class Foo(x: Int):
def foo = bar(x) Workaround+ val i2 = i
new Bar:
- def j = i
+ def j = i2 |
It seems inlining local classes has lots of problems. Can we outlaw it completely? |
This is the foundation we need to specialize by inclining. Probably many libraries use it already. |
Fixes a part of scala#13334 which now works for `transparent inline`.
Fixes a part of scala#13334 which now works for `transparent inline`.
After #14568 the "bad type problem" is fixed. But we now get a new problem for the original code from @soronpo:
I verified that the same error occurs even without #14568 if we disable the "bad type problem" check. |
[skip community_build] closes scala#13334
Compiler version
v3.0.2-RC1 (also tried on master branch)
Minimized code
Output
See scastie: https://scastie.scala-lang.org/yZG6miffRf6f4O6od68i2w
Expectation
No runtime error.
The text was updated successfully, but these errors were encountered: