You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importcollection.AbstractIteratorvalit=newAbstractIterator[Byte]:overrideinlinedefhasNext:Boolean=falseoverrideinlinedefnext():Byte=Iterator.empty.next()
classFastIteratorextendsAbstractIterator[Byte]:overrideinlinedefhasNext:Boolean=falseoverrideinlinedefnext():Byte=Iterator.empty.next()
valok=FastIterator()
@main deftest() =println:
valtester= it
if tester.hasNext then
tester.next()
else"nothing"
Output
There is no inlining, but also no messaging that tells me my plea to inline went unheard.
For the case of successful inlining, there is a nice constant but no branch elimination. Edit: that's because hasNext is Boolean not false. Another quirk is that omitting the type means inferring it from the overridden member; it might make more sense to infer the type of an inline method from its RHS, as in days of yore.
Compiler version
3.7
Minimized code
Output
There is no inlining, but also no messaging that tells me my plea to
inline
went unheard.For the case of successful inlining, there is a nice constant but no branch elimination. Edit: that's because
hasNext
isBoolean
notfalse
. Another quirk is that omitting the type means inferring it from the overridden member; it might make more sense to infer the type of an inline method from its RHS, as in days of yore.Expectation
A peep that my
inline
method could never be inlined.Noticed at #22507
The text was updated successfully, but these errors were encountered: