diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-06-02 17:56:19 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-06-05 11:46:13 +0200 |
commit | 86e6e9290a403ea852c33ca0901bdfc71bce1d67 (patch) | |
tree | 5ee6a26130b1ff894a1440193191b3f453bfd67d /test/files/run | |
parent | d70c0e344d420af1d8520b0a73109850f66c518c (diff) | |
download | scala-86e6e9290a403ea852c33ca0901bdfc71bce1d67.tar.gz scala-86e6e9290a403ea852c33ca0901bdfc71bce1d67.tar.bz2 scala-86e6e9290a403ea852c33ca0901bdfc71bce1d67.zip |
SI-7264 Initialize owner when searching for companion.
From ClassSymbol:
protected final def companionModule0: Symbol =
flatOwnerInfo.decl(name.toTermName).suchThat(sym => sym.isModuleNotMethod && (sym isCoDefinedWith this))
protected final def flatOwnerInfo: Type = {
if (needsFlatClasses)
info
owner.rawInfo
}
Note the call to `rawInfo`; in the enclosed test case, that gives
us back an uninitialized type for the module class of `Foo`, and
consequently we don't find the companion for `Foo.Values`.
This commit forces the initialization of the owning symbol if it
was compiled in a prior run.
In addition, it adds a special case to `Run#compiles` for early
initialized symbols, which start out in life with the wrong owner.
As best as I can see, that complexity stems from allowing early
initialized members *without* return types to be used as value arguments
to the super call, which in turn is needed to infer parent type arguments.
The situation is described a little further in existing comments of
`typedPrimaryConstrBody`.
This bug is essentially another case of SI-6976. See the comments in pull
request of that patch (https://github.com/scala/scala/pull/1910) for
commit archaeology that shows why we're reluctant to force the owner
info more broadly than is done in this commit.
Diffstat (limited to 'test/files/run')
0 files changed, 0 insertions, 0 deletions