Skip to content

Instantly share code, notes, and snippets.

@paulp
Created February 4, 2014 18:27
Show Gist options
  • Save paulp/8809412 to your computer and use it in GitHub Desktop.
Save paulp/8809412 to your computer and use it in GitHub Desktop.
import com.codecommit.gll._
import org.specs2.ScalaCheck
import org.specs2.mutable._
trait Foo extends Specification with Parsers with ScalaCheck {
check { (left: String, right: String) =>
// import java.lang.String
if (false)
null == null
else
(left | right).first eq ""
}
}
// Without the import: compiles
//
// With the import:
// error: type mismatch;
// found : => Any
// required: AnyRef
// Note that <byname> extends Any, not AnyRef.
// Such types can participate in value classes, but instances
// cannot appear in singleton types or in reference comparisons.
// one error found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment