File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -914,14 +914,22 @@ object desugar {
914914 def badRightAssoc (problem : String ) =
915915 report.error(i " right-associative extension method $problem" , mdef.srcPos)
916916 ext.paramss ++ mdef.paramss
917- params1 match
917+ def noVParam = badRightAssoc(" must start with a single parameter" )
918+ def checkVparam (params : ParamClause ) = params match
918919 case ValDefs (vparam :: Nil ) =>
919920 if ! vparam.mods.is(Given ) then
920921 val (leadingUsing, otherExtParamss) = ext.paramss.span(isUsingOrTypeParamClause)
921922 leadingUsing ::: params1 :: otherExtParamss ::: paramss1
922923 else badRightAssoc(" cannot start with using clause" )
923924 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+
925933 case _ =>
926934 ext.paramss ++ mdef.paramss
927935 ).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