We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0cf5d0 commit ab2e1bbCopy full SHA for ab2e1bb
compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -70,6 +70,10 @@ trait TypeAssigner {
70
case ex: StaleSymbol => false
71
}
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
+ */
77
def accessibleType(tpe: Type, superAccess: Boolean)(using Context): Type =
78
tpe match
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 =
97
val tpe1 = accessibleType(tpe, superAccess)
98
if tpe1.exists then tpe1
0 commit comments