From 357905c9555f8081784acd1912cf0681b145ca8b Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 17 Jan 2014 09:27:55 +0100 Subject: SI-5954 Invalidate TypeRef cache when opening package object I noticed that the pos/5954d was tripping a println "assertion". This stemmed from an inconsistency between `TypeRef#{parents, baseTypeSeq}` for a package objects compiled from source that also has a class file from a previous compilation run. I've elevated the println to a devWarning, and changed `updatePosFlags`, the home of this evil symbol overwriting, to invalidate the caches in the symbols info. Yuck. I believe that this symptom is peculiar to package objects because of the way that the completer for packages calls `parents` during the Namer phase for package objects, before we switch the symbol to represent the package-object-from-source. But it seems prudent to defensively invalidate the caches for any symbol that finds its way into `updatePosFlags`. --- test/files/pos/t5954d.flags | 1 + test/files/pos/t5954d/A_1.scala | 6 ++++++ test/files/pos/t5954d/B_2.scala | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 test/files/pos/t5954d.flags create mode 100644 test/files/pos/t5954d/A_1.scala create mode 100644 test/files/pos/t5954d/B_2.scala (limited to 'test/files/pos') diff --git a/test/files/pos/t5954d.flags b/test/files/pos/t5954d.flags new file mode 100644 index 0000000000..6ced0e7090 --- /dev/null +++ b/test/files/pos/t5954d.flags @@ -0,0 +1 @@ +-Xfatal-warnings -Xdev diff --git a/test/files/pos/t5954d/A_1.scala b/test/files/pos/t5954d/A_1.scala new file mode 100644 index 0000000000..8465e8f8c6 --- /dev/null +++ b/test/files/pos/t5954d/A_1.scala @@ -0,0 +1,6 @@ +package p { + package object base { + class B + object B + } +} diff --git a/test/files/pos/t5954d/B_2.scala b/test/files/pos/t5954d/B_2.scala new file mode 100644 index 0000000000..a4aa2eb587 --- /dev/null +++ b/test/files/pos/t5954d/B_2.scala @@ -0,0 +1,7 @@ +package p { + trait T { + class B + object B + } + package object base extends T +} -- cgit v1.2.3