-
Notifications
You must be signed in to change notification settings - Fork 1k
Coding example of "Variances" corrected #1654
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
Conversation
is there someone watching this repo who could review this...? |
The original code works, but not in a REPL. This is a rather roundabout way to make it work. Just remove the enclosing objects that extend App instead. |
_tour/variances.md
Outdated
@@ -38,23 +38,20 @@ In the following example, the method `printAnimalNames` will accept a list of an | |||
|
|||
```tut | |||
object CovarianceTest extends App { |
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.
Just eliminate the object instead of selecting from it
_tour/variances.md
Outdated
@@ -87,18 +84,15 @@ If a `Printer[Cat]` knows how to print any `Cat` to the console, and a `Printer[ | |||
|
|||
```tut | |||
object ContravarianceTest extends App { |
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.
Just eliminate the object instead of selecting from it
@andreamarconi interested in responding to the review feedback? |
@SethTisue no it's perfectly clear now, i tried the code without using a REPL and work perfectly |
I've added some commits that get CI passing. @martijnhoekstra I'm confused about where the actual fix is here. I must be missing something that's right in front of my face. wouldn't your suggestion just take us back to the original code? |
@SethTisue the issue is that this doesn't work in the repl, because The easy fix is to remove the entire enclosing object, including the
to plain
|
oh, I was confused, I thought this PR was the one to introduce the wrapper in the first place, but I see now that it wasn't |
The coding example inside the Variances (both in Covariance and Contravariance) wasn't completely working, even if the proposed solution could be unelegant it should make possible for everyone to try it on their own platform.
tut doesn't like the last line to be a comment, apparently. I'm not even going to report the problem upstream given that tut is deprecated anyway, the author recommends people switch to mdoc
thank you Andrea and Martijn! |
The coding example inside the Variances (both in Covariance and Contravariance) wasn't completely working (as reported in #1533 ) , even if the proposed solution could be unelegant it should make possible for everyone to try it on their own platform.