File tree 2 files changed +12
-2
lines changed
compiler/src/dotty/tools/dotc/ast
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -914,14 +914,22 @@ object desugar {
914
914
def badRightAssoc (problem : String ) =
915
915
report.error(i " right-associative extension method $problem" , mdef.srcPos)
916
916
ext.paramss ++ mdef.paramss
917
- params1 match
917
+ def noVParam = badRightAssoc(" must start with a single parameter" )
918
+ def checkVparam (params : ParamClause ) = params match
918
919
case ValDefs (vparam :: Nil ) =>
919
920
if ! vparam.mods.is(Given ) then
920
921
val (leadingUsing, otherExtParamss) = ext.paramss.span(isUsingOrTypeParamClause)
921
922
leadingUsing ::: params1 :: otherExtParamss ::: paramss1
922
923
else badRightAssoc(" cannot start with using clause" )
923
924
case _ =>
924
- badRightAssoc(" must start with a single parameter" )
925
+ noVParam
926
+ params1 match
927
+ case TypeDefs (_) => paramss1 match
928
+ case params2 :: _ => checkVparam(params2)
929
+ case _ => noVParam
930
+ case _ =>
931
+ checkVparam(params1)
932
+
925
933
case _ =>
926
934
ext.paramss ++ mdef.paramss
927
935
).withMods(mdef.mods | ExtensionMethod )
Original file line number Diff line number Diff line change
1
+ extension (s : String )
2
+ def :*: [T <: Tuple ](that : T ) : String *: T = ???
You can’t perform that action at this time.
0 commit comments