Skip to content

crash on compilable code: scala.MatchError: Ident... #1665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
helloqirun opened this issue Nov 6, 2016 · 0 comments
Closed

crash on compilable code: scala.MatchError: Ident... #1665

helloqirun opened this issue Nov 6, 2016 · 0 comments

Comments

@helloqirun
Copy link

helloqirun commented Nov 6, 2016

scalac can compile but dotc crashes.

$ cat abc.scala

import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
object Test extends App {
  val mutant = new { val x = 2 }
  val c = cm.classSymbol(mutant.getClass)
  !=(c)
  println(c.fullName)
  c.info.toString.lines
    .filter(_ != "  private var bitmap$init$0: Boolean") foreach println
}

$ dotc abc.scala

exception while transforming Test.!=(Test.c) of class class dotty.tools.dotc.ast.Trees$Apply # 285
exception while transforming () extends Object() with App {
  val mutant: Object =
    {
      final class $anon() extends Object() {
        val x: Int = 2
      }
      new Object{...}(): Object
    }
  val c: scala.reflect.runtime.package.universe.ClassSymbol =
    scala.reflect.runtime.currentMirror.classSymbol(Test.mutant.getClass())
  Test.!=(Test.c)
  println(Test.c.fullName)
  augmentString(Test.c.info.toString()).lines.filter(
    {
      def $anonfun(_$1: String): Boolean = _$1.!=("  private var bitmap$init$0: Boolean")
      closure($anonfun)
    }
  ).foreach[Unit^](
    {
      def $anonfun(x: Any): Unit^ = println(x)
      closure($anonfun)
    }
  )
} of class class dotty.tools.dotc.ast.Trees$Template # 306
exception while transforming @scala.annotation.internal.SourceFile("abc.scala") final module class Test$() extends Object() with App {
  val mutant: Object =
    {
      final class $anon() extends Object() {
        val x: Int = 2
      }
      new Object{...}(): Object
    }
  val c: scala.reflect.runtime.package.universe.ClassSymbol =
    scala.reflect.runtime.currentMirror.classSymbol(Test.mutant.getClass())
  Test.!=(Test.c)
  println(Test.c.fullName)
  augmentString(Test.c.info.toString()).lines.filter(
    {
      def $anonfun(_$1: String): Boolean = _$1.!=("  private var bitmap$init$0: Boolean")
      closure($anonfun)
    }
  ).foreach[Unit^](
    {
      def $anonfun(x: Any): Unit^ = println(x)
      closure($anonfun)
    }
  )
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 307
exception while transforming package <empty> {
  final lazy module val Test: Test$ = new Test$()
  @scala.annotation.internal.SourceFile("abc.scala") final module class Test$() extends Object() with App {
    val mutant: Object =
      {
        final class $anon() extends Object() {
          val x: Int = 2
        }
        new Object{...}(): Object
      }
    val c: scala.reflect.runtime.package.universe.ClassSymbol =
      scala.reflect.runtime.currentMirror.classSymbol(Test.mutant.getClass())
    Test.!=(Test.c)
    println(Test.c.fullName)
    augmentString(Test.c.info.toString()).lines.filter(
      {
        def $anonfun(_$1: String): Boolean = _$1.!=("  private var bitmap$init$0: Boolean")
        closure($anonfun)
      }
    ).foreach[Unit^](
      {
        def $anonfun(x: Any): Unit^ = println(x)
        closure($anonfun)
      }
    )
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 308

exception occurred while compiling abc.scala
Exception in thread "main" scala.MatchError: Ident($bang$eq) (of class dotty.tools.dotc.ast.Trees$Ident)
        at dotty.tools.dotc.transform.InterceptedMethods.qual$lzycompute$1(InterceptedMethods.scala:99)
        at dotty.tools.dotc.transform.InterceptedMethods.qual$1(InterceptedMethods.scala:99)
        at dotty.tools.dotc.transform.InterceptedMethods.transformApply(InterceptedMethods.scala:106)
        at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.goApply(TreeTransform.scala:602)
        at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformUnnamed(TreeTransform.scala:1005)
        at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1179)
        at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1171)
        at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:132)
        at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
<snipped>
@nicolasstucki nicolasstucki self-assigned this Nov 8, 2016
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 8, 2016
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 8, 2016
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 15, 2016
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 15, 2016
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 15, 2016
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 16, 2016
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 22, 2016
DarkDimius added a commit that referenced this issue Dec 3, 2016
Fix #1665: Check that != has an operand on the left.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants