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

Fix #6484: Properly unpickle some Scala 2 type lambdas #6494

Merged
merged 1 commit into from
May 11, 2019

Commits on May 10, 2019

  1. Fix scala#6484: Properly unpickle some Scala 2 type lambdas

    Scala 2 pickles both type lambdas and polymorphic methods using the
    POLYtpe tag. When we unpickle them, we distinguish them based on whether
    the symbol for the owner of the type parameters is a term or a type, but
    it seems that some type parameter symbols for type lambdas are pickled
    with a term owner. In Eff for example, the pickled information for the
    `runReader` method in:
    https://github.com/atnos-org/eff/blob/85bd7b2dc1cd26c22e45d69910755f2a9ea4ece4/shared/src/main/scala/org/atnos/eff/syntax/reader.scala#L12
    contains a POLYtpe `[A] => A` (because `Reader` is defined in cats as
    `type Reader[A, B] = Kleisli[Id, A, B]`, and `Id` is defined as
    `type Id[A] = A`), somehow the owner of the symbol for `A` is the
    object `reader` defined in the same file.
    
    That doesn't make any sense to me, but just checking if the owner is
    actually a method should work just as well and fixes the problem. Given
    that Scala 2 unpickling support is a temporary crutch I think that's
    good enough.
    smarter committed May 10, 2019
    Configuration menu
    Copy the full SHA
    c70f6e5 View commit details
    Browse the repository at this point in the history