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 @@ -525,7 +525,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
525525 def makeRetaining (parent : Tree , refs : List [Tree ], annotName : TypeName )(using Context ): Annotated =
526526 Annotated (parent, New (scalaAnnotationDot(annotName), List (refs)))
527527
528- def makeCapsOf (tp : Tree )(using Context ): Tree =
528+ def makeCapsOf (tp : RefTree )(using Context ): Tree =
529529 TypeApply (Select (scalaDot(nme.caps), nme.capsOf), tp :: Nil )
530530
531531 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 @@ -1548,22 +1548,20 @@ object Parsers {
15481548 case _ => None
15491549 }
15501550
1551- /** CaptureRef ::= (ident | `this`) [`*` | `^`]
1551+ /** CaptureRef ::= SimpleRef { `.` id } [`*` | `^`]
15521552 */
15531553 def captureRef (): Tree =
1554- val ref = singleton( )
1554+ val ref = dotSelectors(simpleRef() )
15551555 if isIdent(nme.raw.STAR ) then
15561556 in.nextToken()
15571557 atSpan(startOffset(ref)):
15581558 PostfixOp (ref, Ident (nme.CC_REACH ))
15591559 else if isIdent(nme.UPARROW ) then
15601560 in.nextToken()
1561- def toTypeSel (r : Tree ): Tree = r match
1562- case id : Ident => cpy.Ident (id)(id.name.toTypeName)
1563- case Select (qual, id) => Select (qual, id.toTypeName)
1564- case _ => r
15651561 atSpan(startOffset(ref)):
1566- makeCapsOf(toTypeSel(ref))
1562+ convertToTypeId(ref) match
1563+ case ref : RefTree => makeCapsOf(ref)
1564+ case ref => ref
15671565 else ref
15681566
15691567 /** CaptureSet ::= `{` CaptureRef {`,` CaptureRef} `}` -- under captureChecking
You can’t perform that action at this time.
0 commit comments