File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -940,7 +940,7 @@ trait Checking {
940940
941941 /** Check that the signature of the class mamber does not return a repeated parameter type */
942942 def checkSignatureRepeatedParam (sym : Symbol )(implicit ctx : Context ): Unit =
943- if (sym.maybeOwner.isClass && sym.info.finalResultType.isRepeatedParam)
943+ if (! sym.isOneOf( Synthetic | InlineProxy | Param ) && sym.info.finalResultType.isRepeatedParam)
944944 ctx.error(em " Cannot return repeated parameter type ${sym.info.finalResultType}" , sym.sourcePos)
945945
946946 /** Verify classes extending AnyVal meet the requirements */
Original file line number Diff line number Diff line change 11object O {
22 def m1 (a : Int * ) = (a : _* ) // error: Cannot return repeated parameter type Int*
33 def m2 (a : Int * ) = { // error: Cannot return repeated parameter type Int*
4- val b = (a : _* )
4+ val b = (a : _* ) // error: Cannot return repeated parameter type Int*
55 b
66 }
77 def m3 (a : Int * ): Any = {
8- val b = (a : _* ) // Ok, does not affect the signature
8+ val b = (a : _* ) // error: Cannot return repeated parameter type Int*
99 b
1010 }
1111 def m4 (a : 2 * ) = (a : _* ) // error: Cannot return repeated parameter type Int*
You can’t perform that action at this time.
0 commit comments