This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gen | |
import shapeless._, record._, labelled._ | |
trait TC[T] | |
object TC { | |
def apply[T](implicit tc: TC[T]): TC[T] = tc | |
implicit val booleanTC: TC[Boolean] = new TC[Boolean] {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.language.experimental.macros | |
import scala.reflect.macros.whitebox | |
import scala.annotation.meta.getter | |
object FirstAnnotation { | |
def applyImpl[T: c.WeakTypeTag, Ann: c.WeakTypeTag](c: whitebox.Context): c.Tree = { | |
import c.universe._ | |
val tpe = weakTypeOf[T] | |
val annTpe = weakTypeOf[Ann] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cast[T](v: Any): Unit = v.asInstanceOf[T] | |
def cast1[T](v: Any): T = v.asInstanceOf[T] | |
val v = BigInt(3) | |
cast[Double](v) // no exception, there should be one | |
cast1[Double](v) // exception, but from repl code after cast1 itself |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ammonite.pprint._, Config.Defaults._ | |
object AmmonitePPrintTest extends App { | |
println(PPrint(ObjDefinitions.Foo(2, "ab")).mkString) | |
println(PPrint(ClsDefinitions.Foo(2, "ab")).mkString) | |
} | |
/* | |
Fails with Ammonite 0.2.7, and more recent dev versions too | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ object ODef { case class Foo(i: Int, s: String) } | |
defined object ODef | |
@ ODef.Foo(2, "ba") | |
res1: cmd0.ODef.Foo = Foo(2, "ba") | |
@ class CDef { case class Foo(i: Int, s: String) } | |
defined class CDef | |
@ object CDef extends CDef | |
defined object CDef | |
@ CDef.Foo(2, "ba") | |
res4: cmd3.CDef.Foo = Foo(2, "ba") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rapture.json.jsonBackends.jackson._ | |
import rapture.json._ | |
import rapture.core._ | |
import modes.returnTry | |
import formatters.humanReadable._ | |
case class Dog(name: String, age: Int) | |
case class DogOwner(dog: Dog, name: String) | |
case class Dog1[T](name: String, age: T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> mima-report-binary-issues | |
[warn] Credentials file /home/alexandre/.ivy2/.credentials does not exist | |
[info] Resolving org.scala-lang#scala-library;2.11.6 ... | |
[info] Compiling 1 Scala source to /home/alexandre/projects/shapeless/core/target/scala-2.11/classes... | |
[info] core: found 18 potential binary incompatibilities | |
[error] * method noopRotateLeftImpl()shapeless.ops.coproduct#RotateLeft in object shapeless.ops.coproduct#RotateLeft does not have a correspondent in new version | |
[error] filter with: ProblemFilters.exclude[MissingMethodProblem]("shapeless.ops.coproduct#RotateLeft.noopRotateLeftImpl") | |
[error] * method implToRotateLeft(shapeless.ops.coproduct#Length,shapeless.ops.nat#Mod,shapeless.ops.coproduct#RotateLeft#Impl)shapeless.ops.coproduct#RotateLeft in object shapeless.ops.coproduct#RotateLeft does not have a correspondent in new version | |
[error] filter with: ProblemFilters.exclude[MissingMethodProblem]("shapeless.ops.coproduct#RotateLeft.implToRotateLeft") | |
[error] * interface shapeless.ops.cop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fetchPIDE(version: Version)(implicit ec: ExecutionContext): Future[List[Path]] = { | |
val repositories = Seq(Repository.ivy2Local, Repository.mavenCentral, Repository.sonatypeReleases) | |
val files = coursier.Files( | |
Seq("https://" -> new File(sys.props("user.home") + "/.libisabelle/cache")), | |
() => sys.error("impossible") | |
) | |
val cachePolicy = Repository.CachePolicy.Default |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.