@@ -1551,11 +1551,7 @@ object Parsers {
15511551          else  { accept(TLARROW ); typ() }
15521552        }
15531553        else  if  in.token ==  LBRACE  &&  followingIsCaptureSet() then 
1554-           val  refs  =  inBraces {
1555-             if  in.token ==  RBRACE  then  Nil  else  commaSeparated(captureRef)
1556-           }
1557-           val  t  =  typ()
1558-           CapturingTypeTree (refs, t)
1554+           CapturingTypeTree (captureSet(), typ())
15591555        else  if  (in.token ==  INDENT ) enclosed(INDENT , typ())
15601556        else  infixType()
15611557
@@ -1941,8 +1937,14 @@ object Parsers {
19411937    def  typeDependingOn (location : Location ):  Tree  = 
19421938      if  location.inParens then  typ()
19431939      else  if  location.inPattern then  rejectWildcardType(refinedType())
1940+       else  if  in.token ==  LBRACE  &&  followingIsCaptureSet() then 
1941+         CapturingTypeTree (captureSet(), infixType())
19441942      else  infixType()
19451943
1944+     def  captureSet ():  List [Tree ] =  inBraces {
1945+       if  in.token ==  RBRACE  then  Nil  else  commaSeparated(captureRef)
1946+     }
1947+ 
19461948/*  ----------- EXPRESSIONS ------------------------------------------------ */ 
19471949
19481950    /**  Does the current conditional expression continue after 
@@ -2012,7 +2014,7 @@ object Parsers {
20122014     *                      |  ‘inline’ InfixExpr MatchClause 
20132015     *  Bindings          ::=  `(' [Binding {`,' Binding}] `)' 
20142016     *  Binding           ::=  (id | `_') [`:' Type] 
2015-      *  Ascription        ::=  `:' InfixType 
2017+      *  Ascription        ::=  `:' [CaptureSet]  InfixType 
20162018     *                      |  `:' Annotation {Annotation} 
20172019     *                      |  `:' `_' `*' 
20182020     *  Catches           ::=  ‘catch’ (Expr | ExprCaseClause) 
@@ -4035,6 +4037,8 @@ object Parsers {
40354037     *                     | 
40364038     *  EnumStat         ::= TemplateStat 
40374039     *                     | Annotations Modifiers EnumCase 
4040+      *  SelfType         ::= id [‘:’ [CaptureSet] InfixType] ‘=>’ 
4041+      *                     | ‘this’ ‘:’ [CaptureSet] InfixType ‘=>’ 
40384042     */  
40394043    def  templateStatSeq ():  (ValDef , List [Tree ]) =  checkNoEscapingPlaceholders {
40404044      val  stats  =  new  ListBuffer [Tree ]
0 commit comments