diff --git a/compiler/src/dotty/tools/repl/ReplDriver.scala b/compiler/src/dotty/tools/repl/ReplDriver.scala index 1c7d83826f00..49201b6b142f 100644 --- a/compiler/src/dotty/tools/repl/ReplDriver.scala +++ b/compiler/src/dotty/tools/repl/ReplDriver.scala @@ -11,6 +11,7 @@ import dotty.tools.dotc.core.Denotations.Denotation import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.NameKinds.SimpleNameKind +import dotty.tools.dotc.core.NameKinds.DefaultGetterName import dotty.tools.dotc.core.NameOps._ import dotty.tools.dotc.core.Names.Name import dotty.tools.dotc.core.StdNames._ @@ -307,6 +308,7 @@ class ReplDriver(settings: Array[String], .membersBasedOnFlags(required = Method, excluded = Accessor | ParamAccessor | Synthetic | Private) .filterNot { denot => defn.topClasses.contains(denot.symbol.owner) || denot.symbol.isConstructor + || denot.symbol.name.is(DefaultGetterName) } val vals = diff --git a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala index bc06727f2ea4..7053e9033fc3 100644 --- a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala +++ b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala @@ -85,6 +85,11 @@ class ReplCompilerTests extends ReplTest { assertEquals("x: Int = 10", storedOutput().trim) } + @Test def defaultParamter = fromInitialState { implicit state => + run("def foo(a: Int = 1): 1 = 1") + assertEquals("def foo(a: Int): 1", storedOutput().trim) + } + @Test def i8677 = fromInitialState { implicit state => run { """|sealed trait T1