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

MatchError in TPrint macro expansion on PolyType #76

Open
mrdziuban opened this issue Jan 28, 2022 · 1 comment
Open

MatchError in TPrint macro expansion on PolyType #76

mrdziuban opened this issue Jan 28, 2022 · 1 comment

Comments

@mrdziuban
Copy link

I'm seeing a MatchError thrown during compilation when TPrintImpl encounters a PolyType. The full error is:

exception during macro expansion: 
scala.MatchError: [+A]Playground.Foo[A] (of class scala.reflect.internal.Types$PolyType)
	at pprint.TPrintLowPri$.typePrintImplRec0(TPrintImpl.scala:151)
	at pprint.TPrintLowPri$.typePrintImplRec(TPrintImpl.scala:32)
	at pprint.TPrintLowPri$.$anonfun$typePrintImplRec0$7(TPrintImpl.scala:103)
	at scala.collection.immutable.List.map(List.scala:246)
	at pprint.TPrintLowPri$.added$2(TPrintImpl.scala:103)
	at pprint.TPrintLowPri$.printArgs$1(TPrintImpl.scala:106)
	at pprint.TPrintLowPri$.typePrintImplRec0(TPrintImpl.scala:200)
	at pprint.TPrintLowPri$.typePrintImplRec(TPrintImpl.scala:32)
	at pprint.TPrintLowPri$.typePrintImpl(TPrintImpl.scala:21)

I was able to put together a minimal reproduction in scastie here that mirrors how this error was triggered in my codebase. For context, this occurs when using PPrint 0.7.1 on scala 2.13.8.

Thank you for all your work on this library!

@mrdziuban mrdziuban changed the title MatchError in macro expansion on PolyType MatchError in TPrint macro expansion on PolyType Jan 28, 2022
@ccarlile
Copy link

I experienced this with the Ammonite Repl 2.5.1 (Scala 2.13.8 Java 17.0.1) and fs2 version 3.2.4:

@ Stream.emit("hello")
cmd1.sc:8: exception during macro expansion:
scala.MatchError: [x]fs2.Pure[x] (of class scala.reflect.internal.Types$PolyType)
	at pprint.TPrintLowPri$.typePrintImplRec0(TPrintImpl.scala:151)
	at pprint.TPrintLowPri$.typePrintImplRec(TPrintImpl.scala:32)
	at pprint.TPrintLowPri$.$anonfun$typePrintImplRec0$7(TPrintImpl.scala:103)
	at scala.collection.immutable.List.map(List.scala:246)
	at pprint.TPrintLowPri$.added$2(TPrintImpl.scala:103)
	at pprint.TPrintLowPri$.printArgs$1(TPrintImpl.scala:106)
	at pprint.TPrintLowPri$.typePrintImplRec0(TPrintImpl.scala:200)
	at pprint.TPrintLowPri$.typePrintImplRec(TPrintImpl.scala:32)
	at pprint.TPrintLowPri$.typePrintImpl(TPrintImpl.scala:21)

          .print(res1, "res1", _root_.scala.None)
                ^
Compilation Failed

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

No branches or pull requests

2 participants