quicklens icon indicating copy to clipboard operation
quicklens copied to clipboard

Compilation crashes when referencing local variable from eachWhere

Open ghostbuster91 opened this issue 4 years ago • 1 comments

Add to ModifyEachWhereTest following test:

  it should "allow referencing local varialbe" in {
    val zmienna = "d"
    modify(z1)(_.name.eachWhere(_.startsWith(zmienna))).using(duplicate) should be(z1dup)
  }

And watch as it burns:

[info] Compiling 1 Scala source to /home/kghost/workspace/sml-oss/quicklens/quicklens/.jvm/target/scala-2.11/test-classes ...
[error] ## Exception when compiling 16 sources to /home/kghost/workspace/sml-oss/quicklens/quicklens/.jvm/target/scala-2.11/test-classes
[error] java.lang.IllegalArgumentException: Could not find proxy for val zmienna: String in List(value zmienna, method apply, <$anon: Function0>, value <local ModifyEachWhereTest>, class ModifyEachWhereTest, package quicklens, package softwaremill, package com, package <root>) (currentOwner= method apply )
[error] scala.tools.nsc.transform.LambdaLift$LambdaLifter.scala$tools$nsc$transform$LambdaLift$LambdaLifter$$searchIn$1(LambdaLift.scala:326)
[error] scala.tools.nsc.transform.LambdaLift$LambdaLifter.scala$tools$nsc$transform$LambdaLift$LambdaLifter$$searchIn$1(LambdaLift.scala:331)
[error] scala.tools.nsc.transform.LambdaLift$LambdaLifter.scala$tools$nsc$transform$LambdaLift$LambdaLifter$$searchIn$1(LambdaLift.scala:331)
[error] scala.tools.nsc.transform.LambdaLift$LambdaLifter.scala$tools$nsc$transform$LambdaLift$LambdaLifter$$searchIn$1(LambdaLift.scala:331)

ghostbuster91 avatar May 23 '20 12:05 ghostbuster91

Similar bugs:

  • https://github.com/lihaoyi/utest/issues/65
  • https://github.com/circe/circe/issues/1309
  • https://stackoverflow.com/questions/27879891/compiler-crash-in-simple-macro-manipulating-a-match-statement

ghostbuster91 avatar May 26 '20 11:05 ghostbuster91