Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.
This repository was archived by the owner on Feb 8, 2022. It is now read-only.

cast class exception using algebra with algebird #179

@johnynek

Description

@johnynek
[info]   java.lang.ClassCastException: com.twitter.algebird.IntRing$ cannot be cast to cats.kernel.CommutativeGroup
[info]   at com.twitter.algebird.IntRing$.additive(Ring.scala:66)
[info]   at com.twitter.algebird.AdjoinedUnitRing.<init>(AdjoinedUnitRing.scala:40)
[info]   at com.twitter.algebird.AdjoinedUnit$.ring(AdjoinedUnitRing.scala:32)
[info]   at com.twitter.algebird.AdjoinedRingSpecification.<init>(AdJoinedUnitRing.scala:40)
[info]   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[info]   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[info]   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[info]   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[info]   at java.lang.Class.newInstance(Class.java:442)
[info]   at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:435)

The code compiled, but at runtime it failed. This resulted from treating a Ring[T] as a Rng[T]. I'll try to repro here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions