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 {
940
940
941
941
/** Check that the signature of the class mamber does not return a repeated parameter type */
942
942
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)
944
944
ctx.error(em " Cannot return repeated parameter type ${sym.info.finalResultType}" , sym.sourcePos)
945
945
946
946
/** Verify classes extending AnyVal meet the requirements */
Original file line number Diff line number Diff line change 1
1
object O {
2
2
def m1 (a : Int * ) = (a : _* ) // error: Cannot return repeated parameter type Int*
3
3
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*
5
5
b
6
6
}
7
7
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*
9
9
b
10
10
}
11
11
def m4 (a : 2 * ) = (a : _* ) // error: Cannot return repeated parameter type Int*
You can’t perform that action at this time.
0 commit comments