File tree 2 files changed +4
-5
lines changed
compiler/src/dotty/tools/dotc
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -3590,7 +3590,7 @@ object Types {
3590
3590
3591
3591
def expectValueTypeOrWildcard (tp : Type , where : => String )(using Context ): Unit =
3592
3592
if ! tp.isValueTypeOrWildcard then
3593
- assert(! ctx.isAfterTyper, where) // we check correct kinds at PostTyper
3593
+ assert(! ctx.isAfterTyper, s " $tp in $ where" ) // we check correct kinds at PostTyper
3594
3594
throw TypeError (em " $tp is not a value type, cannot be used $where" )
3595
3595
3596
3596
/** An extractor object to pattern match against a nullable union.
Original file line number Diff line number Diff line change @@ -224,14 +224,13 @@ abstract class Recheck extends Phase, SymTransformer:
224
224
def recheckBind (tree : Bind , pt : Type )(using Context ): Type = tree match
225
225
case Bind (name, body) =>
226
226
recheck(body, pt)
227
- val sym = tree.symbol
228
- if sym.isType then sym.typeRef else sym.info
227
+ tree.symbol.namedType
229
228
230
229
def recheckLabeled (tree : Labeled , pt : Type )(using Context ): Type = tree match
231
230
case Labeled (bind, expr) =>
232
- val bindType = recheck(bind, pt)
231
+ val ( bindType : NamedType ) = recheck(bind, pt): @ unchecked
233
232
val exprType = recheck(expr, defn.UnitType )
234
- bindType
233
+ bindType.symbol.info
235
234
236
235
def recheckValDef (tree : ValDef , sym : Symbol )(using Context ): Unit =
237
236
if ! tree.rhs.isEmpty then recheck(tree.rhs, sym.info)
You can’t perform that action at this time.
0 commit comments