Skip to content

Commit

Permalink
Use val for classCtx in superOrThisCallContext (scala#20213)
Browse files Browse the repository at this point in the history
It seems we don't need `var` here.
  • Loading branch information
nicolasstucki authored Apr 17, 2024
2 parents 1e520b8 + 482bec8 commit b93c337
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ object Contexts {

/** The super- or this-call context with given owner and locals. */
private def superOrThisCallContext(owner: Symbol, locals: Scope): FreshContext = {
var classCtx = outersIterator.dropWhile(!_.isClassDefContext).next()
val classCtx = outersIterator.dropWhile(!_.isClassDefContext).next()
classCtx.outer.fresh.setOwner(owner)
.setScope(locals)
.setMode(classCtx.mode)
Expand Down

0 comments on commit b93c337

Please sign in to comment.