Open
Description
Compiler version
3.4.0-RC1-bin-20230822-3783220-NIGHTLY and before
Minimized code
extension (s: String)
def doubled = s ++ s
def quadrupled = doubled ++ doubled
Output
[error] FakeRecursiveExtension.scala:3:20
[error] Overloaded or recursive method quadrupled needs return type
[error] def quadrupled = doubled ++ doubled
[error] ^
Expectation
I would expect the compiler to be able to infer the type of quadrupled
so that the snippet above compiles successfully. Interestingly, the problem doesn't occur if the extension method is used with a prefix: def quadrupled = s.doubled ++ s.doubled
.
If for some surprising reason the inference problem cannot be fixed easily, at least the error message should be improved.