typelevel / typelevel/cats

upgrading to Cats 2.8.0 causes scalac exception during compilation of downstream lib

Open
#4,280 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
5.5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
5

Description

My lib thomas sees a compilation failure with a scalac exception

scala.reflect.internal.Types$NoCommonType: lub/glb of incompatible types: [_] and  <: Product

I am submitting this issue mainly to create a record so that when/if other users seeing the same issue can reference this one.
I have no clue about the nature of the scalac exception or possible causes. There isn't much detail provided by scalac for debugging. The somewhat more detailed scalac debug log here

debug] Initial set of included nodes: 
[debug] Recompiling all sources: number of invalidated sources > 50.0% of all sources
[debug] compilation cycle 1
[info] compiling 25 Scala sources to /Users/kailuowang/projects/thomas/analysis/target/scala-2.12/classes ...
[debug] Getting org.scala-sbt:compiler-bridge_2.12:1.7.0:compile for Scala 2.12.16
[debug] [zinc] Running cached compiler 2a957a3f for Scala compiler version 2.12.16
[debug] [zinc] The Scala compiler is invoked with:
[debug] 	-encoding
[debug] 	utf8
[debug] 	-deprecation
[debug] 	-feature
[debug] 	-unchecked
[debug] 	-language:existentials
[debug] 	-language:experimental.macros
[debug] 	-language:higherKinds
[debug] 	-language:implicitConversions
[debug] 	-Xcheckinit
[debug] 	-Xlint:adapted-args
[debug] 	-Xlint:by-name-right-associative
[debug] 	-Xlint:constant
[debug] 	-Xlint:delayedinit-select
[debug] 	-Xlint:doc-detached
[debug] 	-Xlint:inaccessible
[debug] 	-Xlint:infer-any
[debug] 	-Xlint:missing-interpolator
[debug] 	-Xlint:nullary-override
[debug] 	-Xlint:nullary-unit
[debug] 	-Xlint:option-implicit
[debug] 	-Xlint:package-object-classes
[debug] 	-Xlint:poly-implicit-overload
[debug] 	-Xlint:private-shadow
[debug] 	-Xlint:stars-align
[debug] 	-Xlint:type-parameter-shadow
[debug] 	-Xlint:unsound-match
[debug] 	-Yno-adapted-args
[debug] 	-Ypartial-unification
[debug] 	-Ywarn-dead-code
[debug] 	-Ywarn-extra-implicit
[debug] 	-Ywarn-nullary-override
[debug] 	-Ywarn-nullary-unit
[debug] 	-Ywarn-numeric-widen
[debug] 	-Ywarn-value-discard
[debug] 	-Ywarn-unused:implicits
[debug] 	-Ywarn-unused:imports
[debug] 	-Ywarn-unused:locals
[debug] 	-Ywarn-unused:params
[debug] 	-Ywarn-unused:patvars
[debug] 	-Ywarn-unused:privates
[debug] 	-Xfatal-warnings
[debug] 	-Xlint:-package-object-classes
[debug] 	
[debug] 	-Xplugin:/Users/kailuowang/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/kind-projector_2.12.16/0.13.2/kind-projector_2.12.16-0.13.2.jar
[debug] 	-Xplugin:/Users/kailuowang/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalamacros/paradise_2.12.16/2.1.1/paradise_2.12.16-2.1.1.jar
[debug] 	-bootclasspath
[debug] 	/Users/kailuowang/.sbt/boot/scala-2.12.16/lib/scala-library.jar
[debug] 	-classpath
....  omitting the classpath
[error] ## Exception when compiling 25 sources to /Users/kailuowang/projects/thomas/analysis/target/scala-2.12/classes
[error] scala.reflect.internal.Types$NoCommonType: lub/glb of incompatible types: [_] and  <: Product

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by compiling the downstream thomas library with Cats 2.8.0, Scala 2.12.16, and the compiler options and plugins shown in the report. Start with the provided scalac exception and debug log; done means identifying a minimal reproducible case and confirming whether Cats or the Scala compiler needs a fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.