diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-04-15 21:11:52 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-04-15 21:11:52 +0200 |
commit | 2b307b4551ea3cb5827ee6db2e0c08f5852b4770 (patch) | |
tree | 04c262bcab50802bcd969626e558a662184f5b8c /src/dotty/tools/backend | |
parent | 52d6ac3833c6daf888d48bcea06a98674243501d (diff) | |
download | dotty-2b307b4551ea3cb5827ee6db2e0c08f5852b4770.tar.gz dotty-2b307b4551ea3cb5827ee6db2e0c08f5852b4770.tar.bz2 dotty-2b307b4551ea3cb5827ee6db2e0c08f5852b4770.zip |
Make dotty Idents transparent for common interface
Scalac in some location(assigns for example) assumes that tree is a Select.
In dotty it could also be an Ident.
Simulate this.
Fixes #477
Diffstat (limited to 'src/dotty/tools/backend')
-rw-r--r-- | src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index e9c8dbc80..bdba2935e 100644 --- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -61,7 +61,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ type Alternative = tpd.Alternative type DefDef = tpd.DefDef type Template = tpd.Template - type Select = tpd.Select + type Select = tpd.Tree // Actually tpd.Select || tpd.Ident type Bind = tpd.Bind type New = tpd.New type Super = tpd.Super @@ -857,8 +857,19 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ } object Select extends SelectDeconstructor { - def _1: Tree = field.qualifier + + override def isEmpty: Boolean = field match { + case t: tpd.Select => false + case t: tpd.Ident => desugarIdent(t).isEmpty + case _ => true + } + + def _1: Tree = field match { + case t: tpd.Select => t.qualifier + case t: tpd.Ident => desugarIdent(t).get + } def _2: Name = field.name + } object Apply extends ApplyDeconstructor { |