File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ trait TypeAssigner {
70
70
case ex : StaleSymbol => false
71
71
}
72
72
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
+ */
73
77
def accessibleType (tpe : Type , superAccess : Boolean )(using Context ): Type =
74
78
tpe match
75
79
case tpe : NamedType =>
@@ -88,6 +92,7 @@ trait TypeAssigner {
88
92
else NoType
89
93
case tpe => tpe
90
94
95
+ /** Try to make `tpe` accessible, emit error if not possible */
91
96
def ensureAccessible (tpe : Type , superAccess : Boolean , pos : SrcPos )(using Context ): Type =
92
97
val tpe1 = accessibleType(tpe, superAccess)
93
98
if tpe1.exists then tpe1
You can’t perform that action at this time.
0 commit comments