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
givenConversion[ String, Int ] withdefapply(from: String):Int= from.toInt // the generate code is def apply(from:String:Int) = apply(from)
Output
The generated code is:
public int apply(java.lang.String);
Code:0: aload_0
1: aload_1
2: invokevirtual #34// Method apply:(Ljava/lang/String;)I, calls apply recusive, so will StackOverflow.5: ireturn
1. Also check apply methods of companions of implicit or given classes.
Specifically apply methods of implicit Conversions.
2. Look inside Inlined nodes to detect loops.
Fixesscala#15474Fixesscala#10947
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.1.2
Demo1 1
Output
The generated code is:
Demo2
The code still compiled to
so run the code will got the StackOverflow error.
The text was updated successfully, but these errors were encountered: