Skip to content
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

Typeable failing in 2.3.3 for code that works in 2.3.2 #812

Closed
m50d opened this issue Feb 8, 2018 · 1 comment · Fixed by #900
Closed

Typeable failing in 2.3.3 for code that works in 2.3.2 #812

m50d opened this issue Feb 8, 2018 · 1 comment · Fixed by #900
Labels

Comments

@m50d
Copy link
Contributor

m50d commented Feb 8, 2018

(Tested under scala 2.11)

The following code works as expected with shapeless 2.3.2

object X {
  case class A()
  case class B(a: A) {
    private[this] val aa = a
  }
}
object Test {
  shapeless.Typeable[X.B]
}

But when using shapeless 2.3.3 I get:

<console>:13: error: No default Typeable for parametrized type X.B
         shapeless.Typeable[X.B]
                           ^
@milessabin milessabin added the Bug label Feb 12, 2018
@milessabin milessabin added this to the shapeless-2.4.0 milestone Feb 12, 2018
@joroKr21
Copy link
Collaborator

joroKr21 commented Feb 12, 2018

This error message is very misleading. Weird how the comment explains something else entirely:

if (nonCaseAccessor) {
// there is a symbol, which is not a case accessor but a val,
// var or param, so we won't be able to type check it safely:
c.abort(c.enclosingPosition, s"No default Typeable for parametrized type $tpe")
}

jeremyrsmith added a commit to jeremyrsmith/shapeless that referenced this issue Jun 11, 2019
Fixes milessabin#812

Don't reject materializing a `Typeable` instance due to the presence of
a non-case-accessor value, unless its type is abstract.
milessabin pushed a commit that referenced this issue Jun 11, 2019
* Loosen typeable restrictions

Fixes #812

Don't reject materializing a `Typeable` instance due to the presence of
a non-case-accessor value, unless its type is abstract.

* Fix Scala 2.10 issue
joroKr21 pushed a commit to joroKr21/shapeless that referenced this issue Apr 23, 2021
* Loosen typeable restrictions

Fixes milessabin#812

Don't reject materializing a `Typeable` instance due to the presence of
a non-case-accessor value, unless its type is abstract.

* Fix Scala 2.10 issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants