diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-10 16:23:35 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-18 10:52:32 +0100 |
commit | fbf8f12105e985bca2f4c907433216b48acc6ce3 (patch) | |
tree | f12b788e4c29fbafec1440ac415d9d1ef44ab995 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | ab06529a54ab59923b78859f03848a377d3e873f (diff) | |
download | dotty-fbf8f12105e985bca2f4c907433216b48acc6ce3.tar.gz dotty-fbf8f12105e985bca2f4c907433216b48acc6ce3.tar.bz2 dotty-fbf8f12105e985bca2f4c907433216b48acc6ce3.zip |
Fix isCoDefinedWith to also work with non-existing symbols
Fixes tests when either symbol or companion object don't actually exist and one goes
from non-existing one to an existing one.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index bce4322ff..2db8ed103 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -430,7 +430,9 @@ object SymDenotations { final def isCoDefinedWith(that: Symbol)(implicit ctx: Context) = (this.effectiveOwner == that.effectiveOwner) && ( !(this.effectiveOwner is PackageClass) - || { val thisFile = this.symbol.associatedFile + || this.isAbsent || that.isAbsent + || { // check if they are defined in the same file(or a jar) + val thisFile = this.symbol.associatedFile val thatFile = that.symbol.associatedFile ( thisFile == null || thatFile == null |