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

Compile without fatal warnings on 2.13.0 #2891

Closed
wants to merge 1 commit into from

Conversation

rossabaker
Copy link
Member

Copy link
Member Author

@rossabaker rossabaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we gave Request this treatment, we might consider doing the same to Response for symmetry, though I don't think there were any binary changes here, so then again, maybe not. Discuss.

val headers: Headers = Headers.empty,
val body: EntityBody[F] = EmptyBody,
val attributes: Vault = Vault.empty
) extends Message[F] with Product with Serializable {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of these interfaces, but:

  • Product makes hash code easier and was there before.
  • Spark folks may be depending on Serializable. I don't judge.

case _ => false
})

def canEqual(that: Any) = that.isInstanceOf[Request[F]]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That F is erased and I'm surprised this didn't generate a warning but _ didn't work. Maybe _[_]? Ugh.

@aeons
Copy link
Member

aeons commented Sep 29, 2019

The unapply on Request seems to fail < 2.13

@hamnis
Copy link
Contributor

hamnis commented Oct 4, 2019

Maybe this would help: https://github.com/alexarchambault/data-class

@rossabaker
Copy link
Member Author

rossabaker commented Oct 5, 2019

I just mentioned data-class on another ticket. 😄 It's can also be a compile-time only dependency, which makes it more attractive for our use case. I'm running out of time for the night, but I'll give that a poke tomorrow.

@hamnis
Copy link
Contributor

hamnis commented Oct 8, 2019

I tried doing this now, and it failed with conflict on withXXX

@hamnis
Copy link
Contributor

hamnis commented Oct 8, 2019

Seems like the only change needed for this to work is changing the pattern match for org.http4s.client.middleware.Logger and org.http4s.server.middleware.Logger

def prelude = message match {
      case r: Request[F] =>
        s"${r.httpVersion} ${r.method} ${r.uri}"

      case Response(status, httpVersion, _, _, _) =>
        s"$httpVersion $status"
}

@hamnis
Copy link
Contributor

hamnis commented Oct 29, 2019

@rossabaker Should I create a new PR to get this moving again?

@rossabaker
Copy link
Member Author

@hamnis That would be wonderful. Thank you!

@rossabaker rossabaker added this to the 0.21.0 milestone Oct 30, 2019
@rossabaker
Copy link
Member Author

Superseded by #2933.

@rossabaker rossabaker closed this Oct 31, 2019
rossabaker added a commit that referenced this pull request Nov 26, 2019
Adapted @rossabaker's patch in #2891 to make it work for 2.12 as well
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

Successfully merging this pull request may close these issues.

None yet

3 participants