Skip to content

Avoid ObjectRefs in the compiler and fix a historical quirk of pattern matcher #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 2.12.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project/ScriptCommands.scala
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ object ScriptCommands {
}

val enableOptimizer = Seq(
scalacOptions in Compile in ThisBuild ++= Seq("-opt:l:inline", "-opt-inline-from:scala/**")
scalacOptions in Compile in ThisBuild ++= Seq("-opt:l:inline,omit-pattern-vars", "-opt-inline-from:scala/**")
)

val noDocs = Seq(
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ trait ScalaSettings extends AbsScalaSettings
val compactLocals = Choice("compact-locals", "Eliminate empty slots in the sequence of local variables.")
val copyPropagation = Choice("copy-propagation", "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code.")
val redundantCasts = Choice("redundant-casts", "Eliminate redundant casts using a type propagation analysis.")
val omitPatternVars = Choice("omit-pattern-vars", "Omit local variables in pattern translation and repeat selection from accessors.")
val boxUnbox = Choice("box-unbox", "Eliminate box-unbox pairs within the same method (also tuples, xRefs, value class instances). Enables unreachable-code.")
val nullnessTracking = Choice("nullness-tracking", "Track nullness / non-nullness of local variables and apply optimizations.")
val closureInvocations = Choice("closure-invocations" , "Rewrite closure invocations to the implementation method.")
Expand Down Expand Up @@ -341,6 +342,7 @@ trait ScalaSettings extends AbsScalaSettings
def optNullnessTracking = optEnabled(optChoices.nullnessTracking)
def optClosureInvocations = optEnabled(optChoices.closureInvocations)
def optInlinerEnabled = optEnabled(optChoices.inline)
def optOmitPatternVars = optEnabled(optChoices.omitPatternVars)

// deprecated inliner levels
def optLProject = optEnabled(optChoices.lProject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ trait MatchTreeMaking extends MatchCodeGen with Debugging {
}

// unless we're optimizing, emit local variable bindings for all subpatterns of extractor/case class patterns
protected val debugInfoEmitVars = !settings.optimise.value
protected val debugInfoEmitVars = !(settings.optimise.value || settings.optOmitPatternVars)

sealed trait PreserveSubPatBinders extends TreeMaker {
val subPatBinders: List[Symbol]
Expand Down
2 changes: 1 addition & 1 deletion versions.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Scala version used for bootstrapping (see README.md)
starr.version=2.12.9
starr.version=2.12.10-bin-584e5bc-SNAPSHOT

# The scala.binary.version determines how modules are resolved. It is set as follows:
# - After 2.x.0 is released, the binary version is 2.x
Expand Down