summaryrefslogtreecommitdiff
path: root/src/repl
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-11-23 15:54:03 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-11-28 15:57:54 +1000
commit1b2cd1be9790bf9c14fd68c78f784d6cb4f7c907 (patch)
treefaf895234a20def5d929a6e476f1d9a4a1d4b488 /src/repl
parent753e848f3d6ac453871450161292139902669695 (diff)
downloadscala-1b2cd1be9790bf9c14fd68c78f784d6cb4f7c907.tar.gz
scala-1b2cd1be9790bf9c14fd68c78f784d6cb4f7c907.tar.bz2
scala-1b2cd1be9790bf9c14fd68c78f784d6cb4f7c907.zip
Support inlining under -Yrepl-class-based REPL
By marking the wrapper classes as sealed, the inliner will be able to assume finality of defs introduces in the REPL without requiring the user to mark them as `final`, which is an odd thing to do in single line of REPL input.
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/IMain.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/IMain.scala b/src/repl/scala/tools/nsc/interpreter/IMain.scala
index 65f2c95f73..99acc34811 100644
--- a/src/repl/scala/tools/nsc/interpreter/IMain.scala
+++ b/src/repl/scala/tools/nsc/interpreter/IMain.scala
@@ -889,7 +889,7 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends
}
class ClassBasedWrapper extends Wrapper {
- def preambleHeader = "class %s extends _root_.java.io.Serializable { "
+ def preambleHeader = "sealed class %s extends _root_.java.io.Serializable { "
/** Adds an object that instantiates the outer wrapping class. */
def postamble = s"""