Git Product home page Git Product logo

Comments (3)

larsrh avatar larsrh commented on May 22, 2024

When trying to call the macro directly, it crashes:

scala> { case class Foo(x: Int); Generic.apply[Foo] }
error: exception during macro expansion: 
scala.ScalaReflectionException: <none> is not a term
        at scala.reflect.api.Symbols$SymbolApi$class.asTerm(Symbols.scala:259)
        at scala.reflect.internal.Symbols$SymbolContextApiImpl.asTerm(Symbols.scala:73)
        at shapeless.GenericMacros$Helper$class.ADT(generic.scala:142)
        at shapeless.GenericMacros$$anon$1.ADT(generic.scala:63)
        at shapeless.GenericMacros$.materialize(generic.scala:69)

The relevant line in generic.scala is:

ADTSingle(tpe, classSym, ExpandingADTCase(tpe, classSym.companionSymbol.asTerm))

The problem is that the call to get the companionSymbol of Foo results in <none>. I would suspect that this is related to SI-7567.

from shapeless.

milessabin avatar milessabin commented on May 22, 2024

Reported issue (your crasher as well @larsrh) still present. It does indeed look like an instance of SI-7567. I can see there that touching Foo.companionSymbol.typeSignature appears to be a workaround ... did either of you try that here?

from shapeless.

milessabin avatar milessabin commented on May 22, 2024

I can't reproduce this any longer. I expect that it was fixed as a result of one of the many prefix related fixes in the last few releases :-)

from shapeless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.