-
Notifications
You must be signed in to change notification settings - Fork 1.4k
makeSome refactoring #9077
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
makeSome refactoring #9077
Conversation
@pablf Thanks for re-opening! Can you include /fixes, etc., in the description? |
@jdegoes the original issues are already closed, should I add something else? |
def dummy(f: Any*): Boolean = { | ||
var l: List[Any] = f.toList | ||
l = Nil | ||
l.isEmpty | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit confused, what is this testing exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test intends to check that the methods before do not create warnings, so it's not useful to test only compilation. Then I got warnings about not using the methods turning into errors. I think I also tried val _ =
syntax but something didn't work. It's not pretty, maybe there is a better approach...
@@ -161,6 +161,7 @@ private[zio] trait LayerMacroUtils { | |||
intersectionTypes | |||
.map(_.dealias) | |||
.filterNot(_.isAny) | |||
.filterNot(t => typeOf[Any] <:< t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the same as the above .filterNot(_.isAny)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure. I remember that somewhere ZAny
didn't get filtered and that broke the algorithm and I think it's here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing it, isAny
alone doesn't work, although just .filterNot(t => typeOf[Any] <:< t)
works alone
Hey @pablf, I just tried to update zio in a codebase at $WORK and I'm getting an exception coming from the macros when using
|
Would you mind sharing a similar example or how the layer is being constructed? Also, which scala version is this? It seems like when retrieving a type from There was a similar issue before that I wasn't able to reproduce so it seems like it was related to some configuration in how Scala treated internally the types. Relevant build details could also be useful. Does this happen in all instances of |
Reported here too: #9145 (comment) |
This reverts commit c16f288.
Continuation of #8850