-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Type refinement lost within nested inline methods #19554
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
Dupe of #8739 (at a glance) |
I believe this is the expected behaviour. transparent inline def foo(x: Int): Int = x
transparent inline def bar(x: Int): Int = foo(x)
transparent inline def baz(x: Int): Int =
val y/*: Int*/ = foo(x)
y
val x1 = bar(0): 0 // OK
val x2 = baz(0): 0 // Error |
This is not exactly the same situation as in #8739. |
I actually replied with a similar minimization on that issue and completely forgot about it 😃. As I mentioned there, I'm constantly hitting this if it's the same issue. This is not a recursive call though. |
It seems that this issue cobined the issue in #8739 and the minimization above and possibly also an extra hurdle with type avoidance. Notice that |
Compiler version
v3.4.0-RC3
Minimized code
Output
Expectation
No error.
The text was updated successfully, but these errors were encountered: