Skip to content

Commit 0139673

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

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
@@ -434,8 +434,7 @@ object TastyFormat {
434434
| ANDtpt
435435
| ORtpt
436436
| BYNAMEtpt
437-
| BIND => true // Dmitry: binds are "shared" as type trees would be shared, see https://github.com/lampepfl/dotty/pull/2510
438-
// But they are not type trees, as you can't have them inside TypeApply. See i2944a.scala
437+
| BIND => true
439438
case _ => false
440439
}
441440

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

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

10311031
def readTpt()(implicit ctx: Context) =
1032-
if (isTypeTreeTag(nextUnsharedTag)) {
1033-
val isShared = nextByte == SHARED
1034-
val term = readTerm()
1035-
term match {
1036-
case a: DefTree if isShared =>
1037-
ref(a.namedType)
1038-
case _ => term
1039-
}
1040-
}
1032+
if (isTypeTreeTag(nextUnsharedTag)) readTerm()
10411033
else {
10421034
val start = currentAddr
10431035
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)