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 c31c24d commit 66546dfCopy full SHA for 66546df
compiler/src/dotty/tools/dotc/transform/Recheck.scala
@@ -256,8 +256,9 @@ abstract class Recheck extends Phase, SymTransformer:
256
bindType.symbol.info
257
258
def recheckValDef(tree: ValDef, sym: Symbol)(using Context): Type =
259
- if tree.rhs.isEmpty then sym.info
260
- else recheck(tree.rhs, sym.info)
+ val resType = recheck(tree.tpt)
+ if tree.rhs.isEmpty then resType
261
+ else recheck(tree.rhs, resType)
262
263
def recheckDefDef(tree: DefDef, sym: Symbol)(using Context): Type =
264
inContext(linkConstructorParams(sym).withOwner(sym)):
0 commit comments