Skip to content

Commit ab2e1bb

Browse files
committed
Add doc comments
1 parent f0cf5d0 commit ab2e1bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ trait TypeAssigner {
7070
case ex: StaleSymbol => false
7171
}
7272

73+
/** If `tpe` is a named type, a normalized version of it that is accessible
74+
* in the current context, or `NoType` if this is not possible.
75+
* Other types are returned unchanged.
76+
*/
7377
def accessibleType(tpe: Type, superAccess: Boolean)(using Context): Type =
7478
tpe match
7579
case tpe: NamedType =>
@@ -88,6 +92,7 @@ trait TypeAssigner {
8892
else NoType
8993
case tpe => tpe
9094

95+
/** Try to make `tpe` accessible, emit error if not possible */
9196
def ensureAccessible(tpe: Type, superAccess: Boolean, pos: SrcPos)(using Context): Type =
9297
val tpe1 = accessibleType(tpe, superAccess)
9398
if tpe1.exists then tpe1

0 commit comments

Comments
 (0)