summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/Mixin.scala3
-rw-r--r--test/files/pos/t4202.scala13
-rw-r--r--test/files/pos/t4363.scala8
4 files changed, 22 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index 0240e80816..d7f9063ec6 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -1309,7 +1309,7 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
* class Foo . companionModule --> object Foo
*/
final def companionModule: Symbol =
- if (isClass && !isAnonOrRefinementClass) companionModule0
+ if (isClass && !isRefinementClass) companionModule0
else NoSymbol
/** For a module: its linked class
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala
index 05224ae37b..caba8f9bd1 100644
--- a/src/compiler/scala/tools/nsc/transform/Mixin.scala
+++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala
@@ -574,10 +574,9 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
private def staticRef(sym: Symbol): Tree = {
sym.owner.info //todo: needed?
sym.owner.owner.info //todo: needed?
- if (sym.owner.sourceModule == NoSymbol) {
+ if (sym.owner.sourceModule == NoSymbol)
assert(false, "" + sym + " in " + sym.owner + " in " + sym.owner.owner +
" " + sym.owner.owner.info.decls.toList)//debug
- }
REF(sym.owner.sourceModule) DOT sym
}
diff --git a/test/files/pos/t4202.scala b/test/files/pos/t4202.scala
index dbedd0bf79..b2a0c0120a 100644
--- a/test/files/pos/t4202.scala
+++ b/test/files/pos/t4202.scala
@@ -1,7 +1,18 @@
-object t4202 {
+object t4202_1 {
() => {
trait T {
def t = ()
}
}
}
+
+object t4202_2 {
+ () => {
+ trait T {
+ def t = ()
+ }
+ object T2 extends T {
+ t
+ }
+ }
+}
diff --git a/test/files/pos/t4363.scala b/test/files/pos/t4363.scala
new file mode 100644
index 0000000000..64cdcd9356
--- /dev/null
+++ b/test/files/pos/t4363.scala
@@ -0,0 +1,8 @@
+object Test {
+ trait Suite { def bar() = () }
+
+ () => {
+ trait FunkySuite extends Suite { override def bar() = () }
+ class MySuite extends FunkySuite { }
+ }
+}