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

SI-7818 Cast our way out of extended existential angst #2916

Merged
merged 1 commit into from Sep 10, 2013

Commits on Sep 6, 2013

  1. SI-7818 Cast our way out of extended existential angst

    `substituteSymbols` is not sophisticated enough to
    operate on `TypeSkolem`-s which are based on one of the
    "from" symbols.
    
    The pertinant usage of `substituteSymbols` for this bug in
    in `Extender`. Recapping on that transform:
    
        // orig
        class C[T](...) extends AnyVal { def foo[U] = <rhs> }
    
        // transform
        class C[T] extends AnyVal { ... }
        object C  { def foo$extension[T', U'] = <rhs'> }
    
    Where `<rhs'>` has been subtituted with, among other things,
    `[T, U] ~> [T', U']`.
    
    In this case our expected type contains a new type parameter
    (of the extension method), whereas the type of the RHS contains
    an existential skolem still pinned to the corresponding class type
    parameter.
    
        tree.tpe         = Observable1#7037[_$1#12344]
        <_$1#12344>.info =  <: T#7040
        pt               = Observable1#7037[T#15644]
    
    The limitation of substution is lamented in the comments
    of `adaptMismatchedSkolems`, which faces the harder version of
    the issue where the skolems are in the expected type.
    
    But, we're in the "easy" case with the skolems in the tree's type;
    we can cast our way out of the problem.
    
    See also f335e44 / ed915c5.
    retronym committed Sep 6, 2013
    Copy the full SHA
    cb028ba View commit details
    Browse the repository at this point in the history