diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-14 14:04:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-14 14:04:41 +0100 |
commit | c7acb7bbb296237dc56ea8d124d6ad4a8dbb7003 (patch) | |
tree | 909daf9beb84babf7b167fd0ab0f15aabac7a77c /compiler/src/dotty/tools/dotc/typer | |
parent | 3a93b3ee128bae804044b25aa7354ce32e074678 (diff) | |
parent | e33ad95fd8e31c80f3615e6feb11d7e583723dd8 (diff) | |
download | dotty-c7acb7bbb296237dc56ea8d124d6ad4a8dbb7003.tar.gz dotty-c7acb7bbb296237dc56ea8d124d6ad4a8dbb7003.tar.bz2 dotty-c7acb7bbb296237dc56ea8d124d6ad4a8dbb7003.zip |
Merge pull request #2091 from dotty-staging/fix-#2077
Fix #2077: Optimization of constant conditionals
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/RefChecks.scala | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index e8ff7d572..d61f5fa68 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -739,11 +739,7 @@ import RefChecks._ * * 2. It warns about references to symbols labeled deprecated or migration. - * 3. It performs the following transformations: - * - * - if (true) A else B --> A - * if (false) A else B --> B - * - macro definitions are eliminated. + * 3. It eliminates macro definitions. * * 4. It makes members not private where necessary. The following members * cannot be private in the Java model: @@ -836,12 +832,6 @@ class RefChecks extends MiniPhase { thisTransformer => tree } - override def transformIf(tree: If)(implicit ctx: Context, info: TransformerInfo) = - tree.cond.tpe match { - case ConstantType(value) => if (value.booleanValue) tree.thenp else tree.elsep - case _ => tree - } - override def transformNew(tree: New)(implicit ctx: Context, info: TransformerInfo) = { currentLevel.enterReference(tree.tpe.typeSymbol, tree.pos) tree |