From 8ef7b3bdc9b517e12f28d91e8269728b77e7630b Mon Sep 17 00:00:00 2001 From: odersky Date: Fri, 23 May 2008 14:24:26 +0000 Subject: [PATCH] fixed #936 git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@15176 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- .../scala/tools/nsc/transform/Mixin.scala | 2 +- .../scala/tools/nsc/typechecker/RefChecks.scala | 2 +- test/files/run/t0936.scala | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 test/files/run/t0936.scala diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index eeb998540..f23104117 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 2af0cbacc..e360270a2 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 000000000..3a7535a5d --- /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") +} +