diff options
author | Martin Odersky <odersky@gmail.com> | 2014-08-28 18:23:40 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-28 18:24:31 +0200 |
commit | 215f73f1f6b8b03b49bdab80fbbfcf4574203d2b (patch) | |
tree | b092d9eb0512476bce78659c84e1794edc1f84ba /src/dotty/tools/dotc/typer/Typer.scala | |
parent | e195a2e31320edc796a6ef84d1ad13dc5b5b3732 (diff) | |
download | dotty-215f73f1f6b8b03b49bdab80fbbfcf4574203d2b.tar.gz dotty-215f73f1f6b8b03b49bdab80fbbfcf4574203d2b.tar.bz2 dotty-215f73f1f6b8b03b49bdab80fbbfcf4574203d2b.zip |
Disable enclding in retyping.
We would like to be able to define unencoded symbolic names in trees computed by the compiler.
The patch avoids their accidental encoding.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 9bf4d8a66..89cf0b055 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -996,13 +996,15 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit } xtree match { - case xtree: untpd.NameTree => typedNamed(xtree withName xtree.name.encode, pt) + case xtree: untpd.NameTree => typedNamed(encodeName(xtree), pt) case xtree: untpd.Import => typedImport(xtree, retrieveSym(xtree)) case xtree => typedUnnamed(xtree) } } } + protected def encodeName(tree: untpd.NameTree)(implicit ctx: Context) = tree withName tree.name.encode + def typed(tree: untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): Tree = /*>|>*/ ctx.traceIndented (i"typing $tree", typr, show = true) /*<|<*/ { assertPositioned(tree) try adapt(typedUnadapted(tree, pt), pt, tree) |