Skip to content

Commit d26669d

Browse files
committed
Revert "Fix Binds being read from tasty as if they were type trees."
This reverts commit 30ec34f.
1 parent 30ec34f commit d26669d

File tree

4 files changed

+3
-19
lines changed

4 files changed

+3
-19
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,7 @@ object TastyFormat {
436436
| ANDtpt
437437
| ORtpt
438438
| BYNAMEtpt
439-
| BIND => true // Dmitry: binds are "shared" as type trees would be shared, see https://github.com/lampepfl/dotty/pull/2510
440-
// But they are not type trees, as you can't have them inside TypeApply. See i2944a.scala
439+
| BIND => true
441440
case _ => false
442441
}
443442

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,15 +1031,7 @@ class TreeUnpickler(reader: TastyReader, nameAtRef: NameRef => TermName, posUnpi
10311031
}
10321032

10331033
def readTpt()(implicit ctx: Context) =
1034-
if (isTypeTreeTag(nextUnsharedTag)) {
1035-
val isShared = nextByte == SHARED
1036-
val term = readTerm()
1037-
term match {
1038-
case a: DefTree if isShared =>
1039-
ref(a.namedType)
1040-
case _ => term
1041-
}
1042-
}
1034+
if (isTypeTreeTag(nextUnsharedTag)) readTerm()
10431035
else {
10441036
val start = currentAddr
10451037
val tp = readType()

tests/pos/i2944.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ trait Map2[K] {
33
def foo: K = {
44
this match {
55
case that: Map2[b] => that.get(3.asInstanceOf[b])
6+
//case that: Map2[c] => that.get(4.asInstanceOf[K])
67
case _ => get(5.asInstanceOf[K])
78
}
89
}

tests/pos/i2944a.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)