Skip to content

Commit

Permalink
Make the show member a DefDef
Browse files Browse the repository at this point in the history
If the show member is a value, then when mutation ocurs in the real
value - the shown value will not reflect the change.
  • Loading branch information
felixmulder committed Aug 23, 2017
1 parent 9e44871 commit 2372340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion repl/src/dotty/tools/repl/ReplCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ReplCompiler(val directory: AbstractFile) extends Compiler {
def createShow(name: TermName, pos: Position) = {
val showName = name ++ "Show"
val select = Select(Ident(name), "show".toTermName)
ValDef(showName, TypeTree(), select).withFlags(Synthetic).withPos(pos)
DefDef(showName, Nil, Nil, TypeTree(), select).withFlags(Synthetic).withPos(pos)
}

val (exps, other) = trees.partition(_.isTerm)
Expand Down

0 comments on commit 2372340

Please sign in to comment.