@@ -1648,11 +1648,8 @@ object Parsers {
16481648
16491649 def expr (location : Location .Value ): Tree = {
16501650 val start = in.offset
1651- if (closureMods.contains(in.token)) {
1652- val imods = modifiers(closureMods)
1653- if (in.token == MATCH ) impliedMatch(start, imods)
1654- else implicitClosure(start, location, imods)
1655- }
1651+ if (closureMods.contains(in.token))
1652+ implicitClosure(start, location, modifiers(closureMods))
16561653 else {
16571654 val saved = placeholderParams
16581655 placeholderParams = Nil
@@ -1854,30 +1851,6 @@ object Parsers {
18541851 }
18551852 }
18561853
1857- /** `match' { ImplicitCaseClauses }
1858- */
1859- def impliedMatch (start : Int , imods : Modifiers ) = {
1860- def markFirstIllegal (mods : List [Mod ]) = mods match {
1861- case mod :: _ => syntaxError(em " illegal modifier for given match " , mod.span)
1862- case _ =>
1863- }
1864- imods.mods match {
1865- case (Mod .Implicit () | Mod .Given ()) :: mods => markFirstIllegal(mods)
1866- case mods => markFirstIllegal(mods)
1867- }
1868- val result @ Match (t, cases) =
1869- matchExpr(EmptyTree , start, InlineMatch )
1870- for (CaseDef (pat, _, _) <- cases) {
1871- def isImplicitPattern (pat : Tree ) = pat match {
1872- case Typed (pat1, _) => isVarPattern(pat1)
1873- case pat => isVarPattern(pat)
1874- }
1875- if (! isImplicitPattern(pat))
1876- syntaxError(em " not a legal pattern for a given match " , pat.span)
1877- }
1878- result
1879- }
1880-
18811854 /** `match' { TypeCaseClauses }
18821855 */
18831856 def matchType (t : Tree ): MatchTypeTree =
@@ -3673,8 +3646,6 @@ object Parsers {
36733646 var imods = modifiers(closureMods)
36743647 if (isBindingIntro)
36753648 stats += implicitClosure(start, Location .InBlock , imods)
3676- else if (in.token == MATCH )
3677- stats += impliedMatch(start, imods)
36783649 else
36793650 stats +++= localDef(start, imods)
36803651 }
0 commit comments