question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shapeless 2.3.5+ can't provide implicit for Generic.Aux

See original GitHub issue

After updating to Shapeless 2.3.5+ some code that used to work with 2.3.3 stopped compiling. A minimal example is:

import shapeless._

trait A
trait B[+A1 <: A]
case class C[T]()

case class D[A1 <: A, B1 <: B[A1]](c: C[B1]) {  
  def bind() = D.bind(this)
}

object D {
  def bind[T, L <: HList](t: T)(implicit gen: Generic.Aux[T, L]) = ???
}

It fails to compile with the following error:

shapeless.this.Generic.materialize is not a valid implicit value for shapeless.Generic.Aux[D[A1,B1],L] because:
hasMatchingSymbol reported error: inferred type arguments [Nothing,B1] do not conform to method apply's type parameter bounds [A1 <: A,B1 <: B[A1]]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
joroKr21commented, Feb 13, 2022
0reactions
joroKr21commented, Feb 1, 2022

Sorry, I didn’t manage - personal life got in the way 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shapeless 2.3.5+ can't provide implicit for Generic.Aux
After updating to Shapeless 2.3.5+ code that used to work stopped compiling. I boiled it down to a minimal, yet still somewhat complicated ......
Read more >
Generic in shapeless 2.3.5+ not working for classes with context ...
It compiles with shapeless 2.3.5+ only if the instance is commented out. ... Fix Generic instance for case classes with implicit arguments #1191....
Read more >
The Type Astronaut's Guide to Shapeless - Books
Shapeless provides two sets of tools to this end: a set of generic data types that can be inspected, traversed, and manipulated at...
Read more >
Fluent – A deep dive into Shapeless and implicit resolution
As promised in my previous post we're going to explore to internal of Fluent and how it uses Shapeless and implicit resolution to...
Read more >
milessabin/shapeless - Gitter
:point_up: Edit: Hi there, I've got some code that isn't working (I assume due to some compiler implicit search depth limitations) and was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found