File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -524,7 +524,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
524524 def makeRetaining (parent : Tree , refs : List [Tree ], annotName : TypeName )(using Context ): Annotated =
525525 Annotated (parent, New (scalaAnnotationDot(annotName), List (refs)))
526526
527- def makeCapsOf (tp : Tree )(using Context ): Tree =
527+ def makeCapsOf (tp : RefTree )(using Context ): Tree =
528528 TypeApply (Select (scalaDot(nme.caps), nme.capsOf), tp :: Nil )
529529
530530 def makeCapsBound ()(using Context ): Tree =
Original file line number Diff line number Diff line change @@ -194,8 +194,7 @@ extension (tp: Type)
194194 true
195195 case tp : TermRef =>
196196 ((tp.prefix eq NoPrefix )
197- || tp.symbol.isField && ! tp.symbol.isStatic && (
198- tp.prefix.isThisTypeOf(tp.symbol.owner) || tp.prefix.isTrackableRef)
197+ || tp.symbol.isField && ! tp.symbol.isStatic && tp.prefix.isTrackableRef
199198 || tp.isRootCapability
200199 ) && ! tp.symbol.isOneOf(UnstableValueFlags )
201200 case tp : TypeRef =>
Original file line number Diff line number Diff line change @@ -1559,22 +1559,20 @@ object Parsers {
15591559 case _ => None
15601560 }
15611561
1562- /** CaptureRef ::= (ident | `this`) [`*` | `^`]
1562+ /** CaptureRef ::= SimpleRef { `.` id } [`*` | `^`]
15631563 */
15641564 def captureRef (): Tree =
1565- val ref = singleton( )
1565+ val ref = dotSelectors(simpleRef() )
15661566 if isIdent(nme.raw.STAR ) then
15671567 in.nextToken()
15681568 atSpan(startOffset(ref)):
15691569 PostfixOp (ref, Ident (nme.CC_REACH ))
15701570 else if isIdent(nme.UPARROW ) then
15711571 in.nextToken()
1572- def toTypeSel (r : Tree ): Tree = r match
1573- case id : Ident => cpy.Ident (id)(id.name.toTypeName)
1574- case Select (qual, id) => Select (qual, id.toTypeName)
1575- case _ => r
15761572 atSpan(startOffset(ref)):
1577- makeCapsOf(toTypeSel(ref))
1573+ convertToTypeId(ref) match
1574+ case ref : RefTree => makeCapsOf(ref)
1575+ case ref => ref
15781576 else ref
15791577
15801578 /** CaptureSet ::= `{` CaptureRef {`,` CaptureRef} `}` -- under captureChecking
You can’t perform that action at this time.
0 commit comments