diff options
author | Martin Odersky <odersky@gmail.com> | 2008-05-23 14:24:26 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-05-23 14:24:26 +0000 |
commit | 100b87f6667c4a6100acaa077d5e1ab90cf04234 (patch) | |
tree | fca69f4de9fd61d448e2f84ab90dcdddd702ad2a | |
parent | 3eae3a2679d0280acf4c8105757aaf87c5a1d14e (diff) | |
download | scala-100b87f6667c4a6100acaa077d5e1ab90cf04234.tar.gz scala-100b87f6667c4a6100acaa077d5e1ab90cf04234.tar.bz2 scala-100b87f6667c4a6100acaa077d5e1ab90cf04234.zip |
fixed #936
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 2 | ||||
-rw-r--r-- | test/files/run/t0936.scala | 17 |
3 files changed, 19 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 21b12f7e9d..2a0c6c05e1 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -772,7 +772,7 @@ abstract class Mixin extends InfoTransform { case Select(Super(_, _), name) => tree - case Select(qual, name) if sym.owner.isImplClass && !isStaticOnly(sym) => + case Select(qual, name) if sym.owner.isImplClass && !isStaticOnly(sym) && enclInterface != null => // refer to fields in some implementation class via an abstract // getter in the interface. if (sym.isMethod) diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index d22ab4942e..46b84f4ac1 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -705,7 +705,7 @@ abstract class RefChecks extends InfoTransform { result } - /** If symbol is deprecated and is not contained in a depreceated definition, + /** If symbol is deprecated and is not contained in a deprecated definition, * issue a deprecated warning */ def checkDeprecated(sym: Symbol, pos: Position) { diff --git a/test/files/run/t0936.scala b/test/files/run/t0936.scala new file mode 100644 index 0000000000..3a7535a5d8 --- /dev/null +++ b/test/files/run/t0936.scala @@ -0,0 +1,17 @@ +object Test extends Application { + def foo = { + + abstract class MouseEventType { def x: String } + case object Clicked extends MouseEventType { + def x = "Clicked" + } + + trait MouseHandler { + def mouseClicked() = handleEvent(Clicked); + def handleEvent(t : MouseEventType) = t.x + } + (new MouseHandler {}).handleEvent(Clicked) + } + assert(foo == "Clicked") +} + |