Commit a664f52
committed
Fix Mixin: remove Module flag in mixin synthesis
Module flag will cause the companion class defined in a trait
to be incorrectly entered as a member of the class that
implement the trait.
The method `Symbol.entered` has the logic to enter the companion class:
if (this.is(Module)) this.owner.asClass.enter(this.moduleClass)
The following is a simple test case:
trait A{
object O
}
class B extends A {
def foo = O
}1 parent d91e42f commit a664f52
File tree
2 files changed
+6
-6
lines changed- compiler/src/dotty/tools/dotc/transform
2 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
| 430 | + | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| |||
0 commit comments