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

NoSuchElementException thrown in REPL when using a type alias to refer to a shapeless coproduct #198

Closed
mpilquist opened this Issue Aug 26, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@mpilquist

mpilquist commented Aug 26, 2015

› ./amm
Loading...
Welcome to the Ammonite Repl 0.4.5
(Scala version 2.11.7 Java 1.8.0_25)
@ load.ivy("com.chuusai" %% "shapeless" % "2.2.5")

@ import shapeless._
import shapeless._
@ Coproduct[Int :+: String :+: CNil](1)
res2: Int :+: String :+: CNil = Inl(1)
@ type X = Int :+: String :+: CNil
defined type X
@ Coproduct[X](1)
Compilation Failed
Main.scala:289: exception during macro expansion:
java.util.NoSuchElementException: head of empty list
        at scala.collection.immutable.Nil$.head(List.scala:420)
        at scala.collection.immutable.Nil$.head(List.scala:417)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.subst(TypeMaps.scala:709)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.substFor$1(TypeMaps.scala:717)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:732)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:685)
        at scala.collection.immutable.List.loop$1(List.scala:173)
        at scala.collection.immutable.List.mapConserve(List.scala:189)
        at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:115)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:716)
        at scala.reflect.internal.Types$Type.subst(Types.scala:705)
        at scala.reflect.internal.Types$TypeApiImpl.substituteTypes(Types.scala:240)
        at scala.reflect.internal.Types$TypeApiImpl.substituteTypes(Types.scala:218)
        at derive.Derive$$anonfun$impl$1$2.apply(Derive.scala:77)
        at derive.Derive$$anonfun$impl$1$2.apply(Derive.scala:74)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.immutable.Set$Set2.foreach(Set.scala:111)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
        at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
        at scala.collection.SetLike$class.map(SetLike.scala:92)
        at scala.collection.AbstractSet.map(Set.scala:47)
        at derive.Derive.impl$1(Derive.scala:74)
        at derive.Derive.fleshedOutSubtypes(Derive.scala:81)
        at derive.Derive.derive$Derive$$onFail$1(Derive.scala:136)
        at derive.Derive$$anonfun$derive$Derive$$rec$1$1.apply(Derive.scala:204)
        at derive.Derive$$anonfun$derive$Derive$$rec$1$1.apply(Derive.scala:178)
        at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:194)
        at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:80)
        at derive.Derive.derive$Derive$$rec$1(Derive.scala:178)
        at derive.Derive.deriveType(Derive.scala:217)
        at derive.Derive.derive(Derive.scala:58)
        at pprint.Internals$LowerPriPPrint$.liftedTree1$1(PPrint.scala:398)
        at pprint.Internals$LowerPriPPrint$.FinalRepr(PPrint.scala:398)

        def $main() = { ammonite.repl.frontend.ReplBridge.repl.Internal.combinePrints(ammonite.repl.frontend.ReplBridge.repl.Internal.print(res4, res4, "res4", None)) }
                                                                                                                                           ^
@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment