This file contains 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 magnolia.{CaseClass, Magnolia, SealedTrait} | |
import scala.language.experimental.macros | |
trait Csv[A] { def apply(a: A): Seq[String] } | |
trait LPCsv { | |
type Typeclass[A] = Csv[A] | |
def combine[A](ctx: CaseClass[Csv, A]): Csv[A] = | |
a => ctx.parameters.foldLeft(List[String]())((acc, p) => acc ++ p.typeclass(p.dereference(a))) |
This file contains 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
[error] error while loading Object, Missing dependency 'object scala in compiler mirror', required by /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/rt.jar(java/lang/Object.class) | |
[error] ## Exception when compiling 5 sources to /my/thing/target/scala-2.12/classes | |
[error] object scala in compiler mirror not found. | |
[error] scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:24) | |
[error] scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:25) | |
[error] scala.reflect.internal.Mirrors$RootsBase.$anonfun$getModuleOrClass$4(Mirrors.scala:61) | |
[error] scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:61) | |
[error] scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:73) | |
[error] scala.reflect.internal.Mirrors$RootsBase.getPackage(Mirrors.scala:179) | |
[error] scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackage$lzycompute(Definitions.scala:196) |
This file contains 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
"pool-11-thread-7" #160 prio=5 os_prio=31 cpu=70645.61ms elapsed=146.72s tid=0x0000000131d56800 nid=0x14303 runnable [0x00000002b5737000] | |
java.lang.Thread.State: RUNNABLE | |
at dotty.tools.dotc.core.Types$VariantTraversal.stopBecauseStaticOrLocal(Types.scala:5532) | |
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5649) | |
at dotty.tools.dotc.core.TypeComparer$$anon$1.apply(TypeComparer.scala:266) | |
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5655) | |
at dotty.tools.dotc.core.TypeComparer$$anon$1.apply(TypeComparer.scala:266) | |
at dotty.tools.dotc.core.Types$TypeMap.op$proxy17$1(Types.scala:5618) | |
at dotty.tools.dotc.core.Types$TypeMap.mapArgs(Types.scala:5618) | |
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5655) |
This file contains 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
java.lang.AssertionError: assertion failed: invalid prefix ExprType(AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),class ValueOf),List(TypeRef(NoPrefix,type L)))) | |
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8) | |
at dotty.tools.dotc.core.Types$NamedType.<init>(Types.scala:2186) | |
at dotty.tools.dotc.core.Types$TypeRef.<init>(Types.scala:2799) | |
at dotty.tools.dotc.core.Types$CachedTypeRef.<init>(Types.scala:2855) | |
at dotty.tools.dotc.core.Uniques$NamedTypeUniques.newType$1(Uniques.scala:45) | |
at dotty.tools.dotc.core.Uniques$NamedTypeUniques.linkedListLoop$1(Uniques.scala:56) | |
at dotty.tools.dotc.core.Uniques$NamedTypeUniques.enterIfNew(Uniques.scala:62) | |
at dotty.tools.dotc.core.Types$TypeRef$.apply(Types.scala:2914) | |
at dotty.tools.dotc.core.Types$TypeRef$.apply(Types.scala:2920) |
This file contains 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
java.lang.StackOverflowError while typechecking /path/to/file.scala | |
scala.runtime.Statics.anyHash(Statics.java:127) | |
scala.collection.immutable.HashMap.get(HashMap.scala:136) | |
dotty.tools.dotc.core.Contexts$Context.property(Contexts.scala:154) | |
dotty.tools.dotc.printing.PlainPrinter.limiter(PlainPrinter.scala:37) | |
dotty.tools.dotc.printing.PlainPrinter.controlled(PlainPrinter.scala:39) | |
dotty.tools.dotc.printing.RefinedPrinter.toText(RefinedPrinter.scala:307) | |
dotty.tools.dotc.core.Types$Type.toText(Types.scala:1911) | |
dotty.tools.dotc.printing.Printer.toTextLocal$$anonfun$1(Printer.scala:170) | |
dotty.tools.dotc.printing.Printer.atPrec(Printer.scala:43) |
This file contains 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.annotation.MacroAnnotation | |
import scala.quoted.* | |
class autoGiven extends MacroAnnotation { | |
final def transform(using Quotes)(tree: quotes.reflect.Definition): List[quotes.reflect.Definition] = { | |
import quotes.reflect.* | |
tree match { | |
case ValDef(name, tpt, Some(rhs)) => rhs.asExpr match { | |
case '{ $rhsExpr: t } => |
This file contains 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
java.lang.StackOverflowError | |
at dotty.tools.dotc.core.Types$VariantTraversal.stopBecauseStaticOrLocal(Types.scala:5539) | |
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5656) | |
at dotty.tools.dotc.core.TypeComparer$$anon$1.apply(TypeComparer.scala:266) | |
at dotty.tools.dotc.core.Types$TypeMap.op$proxy18$1(Types.scala:5658) | |
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5658) | |
at dotty.tools.dotc.core.TypeComparer$$anon$1.apply(TypeComparer.scala:266) | |
at dotty.tools.dotc.core.Types$TypeMap.op$proxy17$1(Types.scala:5625) | |
at dotty.tools.dotc.core.Types$TypeMap.mapArgs(Types.scala:5625) | |
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5662) |
This file contains 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
case class Foo() | |
case class Bar(foo: Foo) | |
// fails because there is no `Decoder[Foo]` | |
io.circe.Decoder.derived[Bar] |
This file contains 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
case class Foo() | |
case class Bar(foo: Foo) | |
// succeeds and automatically derives a `Decoder[Foo]` | |
io.circe.Decoder.derived[Bar] |
This file contains 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
sealed trait Test1 | |
object Test1 { | |
case object Member extends Test1 | |
} | |
sealed trait Test2 | |
object Test2 { | |
sealed trait SubTrait extends Test2 | |
case object Member extends SubTrait | |
} |