@@ -1641,11 +1641,8 @@ object Parsers {
16411641
16421642 def expr (location : Location .Value ): Tree = {
16431643 val start = in.offset
1644- if (closureMods.contains(in.token)) {
1645- val imods = modifiers(closureMods)
1646- if (in.token == MATCH ) impliedMatch(start, imods)
1647- else implicitClosure(start, location, imods)
1648- }
1644+ if (closureMods.contains(in.token))
1645+ implicitClosure(start, location, modifiers(closureMods))
16491646 else {
16501647 val saved = placeholderParams
16511648 placeholderParams = Nil
@@ -1847,30 +1844,6 @@ object Parsers {
18471844 }
18481845 }
18491846
1850- /** `match' { ImplicitCaseClauses }
1851- */
1852- def impliedMatch (start : Int , imods : Modifiers ) = {
1853- def markFirstIllegal (mods : List [Mod ]) = mods match {
1854- case mod :: _ => syntaxError(em " illegal modifier for given match " , mod.span)
1855- case _ =>
1856- }
1857- imods.mods match {
1858- case (Mod .Implicit () | Mod .Given ()) :: mods => markFirstIllegal(mods)
1859- case mods => markFirstIllegal(mods)
1860- }
1861- val result @ Match (t, cases) =
1862- matchExpr(EmptyTree , start, InlineMatch )
1863- for (CaseDef (pat, _, _) <- cases) {
1864- def isImplicitPattern (pat : Tree ) = pat match {
1865- case Typed (pat1, _) => isVarPattern(pat1)
1866- case pat => isVarPattern(pat)
1867- }
1868- if (! isImplicitPattern(pat))
1869- syntaxError(em " not a legal pattern for a given match " , pat.span)
1870- }
1871- result
1872- }
1873-
18741847 /** `match' { TypeCaseClauses }
18751848 */
18761849 def matchType (t : Tree ): MatchTypeTree =
@@ -3664,8 +3637,6 @@ object Parsers {
36643637 var imods = modifiers(closureMods)
36653638 if (isBindingIntro)
36663639 stats += implicitClosure(start, Location .InBlock , imods)
3667- else if (in.token == MATCH )
3668- stats += impliedMatch(start, imods)
36693640 else
36703641 stats +++= localDef(start, imods)
36713642 }
0 commit comments