diff options
author | Martin Odersky <odersky@gmail.com> | 2014-10-19 16:57:14 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-10-26 16:24:01 +0100 |
commit | 1a81244b68e58bde6a3d03551f1d92f15c3ff719 (patch) | |
tree | 30055185c94c52ac8e78b894af162f818c95f8e2 /src/dotty/tools/dotc/core/Symbols.scala | |
parent | 0f3a903bebdac5eeaa84b2f8fdd0298bd15468f2 (diff) | |
download | dotty-1a81244b68e58bde6a3d03551f1d92f15c3ff719.tar.gz dotty-1a81244b68e58bde6a3d03551f1d92f15c3ff719.tar.bz2 dotty-1a81244b68e58bde6a3d03551f1d92f15c3ff719.zip |
Fix to TreeTypeMap
Now handles the case where a class symbol itself is not changed by the map,
but one of its declarations is. In this case we need to back out, and create
new symbols for the class and all other symbols that are defined in the same scope as
the class.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index cedc0adc8..83fb2c134 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -267,10 +267,10 @@ trait Symbols { this: Context => * Cross symbol references are brought over from originals to copies. * Do not copy any symbols if all attributes of all symbols stay the same. */ - def mapSymbols(originals: List[Symbol], ttmap: TreeTypeMap): List[Symbol] = - if (originals forall (sym => + def mapSymbols(originals: List[Symbol], ttmap: TreeTypeMap, mapAlways: Boolean = false): List[Symbol] = + if (originals.forall(sym => (ttmap.mapType(sym.info) eq sym.info) && - !(ttmap.oldOwners contains sym.owner))) + !(ttmap.oldOwners contains sym.owner)) && !mapAlways) originals else { val copies: List[Symbol] = for (original <- originals) yield |