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

Weird interaction with refined #16

Open
vil1 opened this issue Mar 15, 2018 · 5 comments
Open

Weird interaction with refined #16

vil1 opened this issue Mar 15, 2018 · 5 comments

Comments

@vil1
Copy link

vil1 commented Mar 15, 2018

I recently stumbled upon a weird interaction between this plugin and refined.

The problem is referenced in a comment of this issue.

To put it simply, when splain is active, the macro expansion from refined start failing (with a weird ClassCastException) when used in the REPL (but everything works fine in regular compiation).

To reproduce the problem, one can define the following build.sbt

scalaVersion in ThisBuild := "2.12.4"

libraryDependencies += "eu.timepit" %% "refined" % "0.8.7"

addCompilerPlugin("io.tryp" %% "splain" % "0.2.7" cross CrossVersion.patch)

and past the following lines in the console:

import eu.timepit.refined._, api._, auto._, char._, generic._, collection._
val str: String Refined Forall[UpperCase] = "FOO"
@tek
Copy link
Owner

tek commented Mar 15, 2018

hm, looks like a problem that will need pretty extensive digging to solve…I'll see if i can find the time 😟

@steinybot
Copy link

steinybot commented Aug 9, 2018

I just found a slightly different variation on this in case it helps the investigation fthomas/refined#556

The interesting thing that I found there was that it works for compile but not for generating docs.

Comparing the output with -Ymacro-debug-verbose showed that for some reason when generating docs it prints "looking for macro implementation: macro method autoRefineV" twice but only once for compile.

@steinybot
Copy link

I found that it also occurs on the eu.timepit.refined.macros.RefineMacro#implApplyRef macro (macro method apply). See fthomas/refined#556 for the specifics.

What I did notice this time is that when it fails it is actually expanding the macro twice.

@tek
Copy link
Owner

tek commented Aug 9, 2018

unfortunately, I am unable to reproduce the problem with any of the test cases specified in those issues.
I assume this is just another incarnation of #4 😞

@tribbloid
Copy link
Collaborator

Just want to point out that we don't have a test template for REPL or ammonite or scalaCLI at the moment.

I'll figure it out eventually, but before that, please include your full error stack trace in your bug report.

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

4 participants