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

Conflicts with WartRemover Null #8

Open
gvolpe opened this issue Apr 23, 2020 · 3 comments
Open

Conflicts with WartRemover Null #8

gvolpe opened this issue Apr 23, 2020 · 3 comments

Comments

@gvolpe
Copy link

gvolpe commented Apr 23, 2020

I have this error when trying to use context-applied in a project that uses the Null wart.

[error] [wartremover:Null] null is disabled

I guess the plugin generates some null values? Using the latest version 0.1.4.

@augustjune
Copy link
Owner

Hey @gvolpe
Thanks for the issue!

Yeah, it does use null as a rhs of value F (or whatever the type parameter is called).
It was a trick to avoid the allocation of a new object.
Something like this:

trait E {}
val F: E = null

E type serves as a tag so F value can later be converted to an instance of Functor[F] (or whatever the context is).

I don't see a straightforward solution to keep the zero allocation cost without using null.
Maybe I can use something else for tagging F value. 🤔
I will play with it and get back to you with that.

@gvolpe
Copy link
Author

gvolpe commented May 5, 2020

Sorry for the delay in getting back to you. If there's a way to use WartRemover's Null while ignoring code generated by Context Applied that would work for me too 😄

I don't know if this is possible, though... 🤔

@steinybot
Copy link

It's a bit of a hack but what about just including @SuppressWarnings(Array("org.wartremover.warts.All")) on all code generated by context-applied?

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

3 participants