Scala Programming Language
  1. Scala Programming Language
  2. SI-4897

correct outer check for match on singleton type of inherited object

    Details

      Description

      class CSuper {
        object A
      }
      class C extends CSuper {
        def f = (null: AnyRef) match { case _: A.type  => 1 }
      }
      
      error: java.lang.Error: no-symbol does not have owner
      	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:32)
      	at scala.reflect.internal.Symbols$NoSymbol$.owner(Symbols.scala:2324)
      	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerSelect(ExplicitOuter.scala:216)
      	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerValue(ExplicitOuter.scala:202)
      	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.transform(ExplicitOuter.scala:480)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1188)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
      	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:259)
      	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.transform(ExplicitOuter.scala:489)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1180)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
      	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:259)
      	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.transform(ExplicitOuter.scala:517)
      

        Activity

        Show
        Adriaan Moors added a comment - https://github.com/scala/scala/pull/952

          People

          • Assignee:
            Adriaan Moors
            Reporter:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development