diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-11-04 00:48:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-04 00:48:36 +0100 |
commit | 6ba6ea542d7915a48b426fea1f75f9cb8c2db424 (patch) | |
tree | f728f6c54fe8c2e57ae136ef08d6fb20eaca534b /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 98a92c6f4ec743edb9465071dcfd43f17dbf054b (diff) | |
parent | d694f15a028cf14ea0cf210d3113c7b1d6af54e7 (diff) | |
download | dotty-6ba6ea542d7915a48b426fea1f75f9cb8c2db424.tar.gz dotty-6ba6ea542d7915a48b426fea1f75f9cb8c2db424.tar.bz2 dotty-6ba6ea542d7915a48b426fea1f75f9cb8c2db424.zip |
Merge pull request #1587 from dotty-staging/change-tasty-pos
Fix Tasty positions
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 56c04c063..c283f43cf 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -953,28 +953,23 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit } def typedTypeTree(tree: untpd.TypeTree, pt: Type)(implicit ctx: Context): TypeTree = track("typedTypeTree") { - if (tree.original.isEmpty) - tree match { - case tree: untpd.DerivedTypeTree => - tree.ensureCompletions - try - TypeTree(tree.derivedType(tree.attachment(untpd.OriginalSymbol))) withPos tree.pos - // btw, no need to remove the attachment. The typed - // tree is different from the untyped one, so the - // untyped tree is no longer accessed after all - // accesses with typedTypeTree are done. - catch { - case ex: NoSuchElementException => - println(s"missing OriginalSymbol for ${ctx.owner.ownersIterator.toList}") - throw ex - } - case _ => - assert(isFullyDefined(pt, ForceDegree.none)) - tree.withType(pt) - } - else { - val original1 = typed(tree.original) - cpy.TypeTree(tree)(original1).withType(original1.tpe) + tree match { + case tree: untpd.DerivedTypeTree => + tree.ensureCompletions + try + TypeTree(tree.derivedType(tree.attachment(untpd.OriginalSymbol))) withPos tree.pos + // btw, no need to remove the attachment. The typed + // tree is different from the untyped one, so the + // untyped tree is no longer accessed after all + // accesses with typedTypeTree are done. + catch { + case ex: NoSuchElementException => + println(s"missing OriginalSymbol for ${ctx.owner.ownersIterator.toList}") + throw ex + } + case _ => + assert(isFullyDefined(pt, ForceDegree.none)) + tree.withType(pt) } } |