Skip to content

Commit 12cf716

Browse files
committed
Fix bugs detected by fuzzing
1 parent 9224cee commit 12cf716

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

compiler/src/dotty/tools/dotc/core/Uniques.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ object Uniques {
6262
if (h == NotCached) newType
6363
else {
6464
val r = findPrevious(h, prefix, designator)
65-
if (r ne null) r else addEntryAfterScan(newType)
65+
if ((r ne null) && (r.isTerm == isTerm)) r else addEntryAfterScan(newType)
6666
}
6767
}
6868
}

tests/neg/parser-stability-1.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object x0 {
2+
x1 match
3+
def this
4+

tests/neg/parser-stability.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class I2[I2] {
2+
def I2: I2 = (I2 => I2) => I2

0 commit comments

Comments
 (0)