Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
base: 204c94c39702
Choose a base ref
...
head repository: crystal-lang/crystal
compare: 917971dedc08
Choose a head ref
  • 3 commits
  • 8 files changed
  • 2 contributors

Commits on Mar 23, 2017

  1. Fix self restriction with including generic module

    Ref: #3847
    
    Now, we can get a compile error with such a code:
    
        module Foo(T)
          def foo(x : T)
            x
          end
        end
    
        abstract struct Bar
          include Foo(self)
        end
    
        struct Baz1 < Bar
        end
    
        struct Baz2 < Bar
        end
    
        Baz1.new.foo Baz2.new # => no overload matches 'Baz1#foo' with type Baz2
    
    This commit adds `lazy_self` parameter to `lookup_type`. When `lazy_self`
    is `true`, `lookup_type` keeps `self` in generics type. It is used to
    look up type for `include` and `extend`.
    makenowjust authored and Brian J. Cardiff committed Mar 23, 2017
    Copy the full SHA
    6645b8f View commit details
    Browse the repository at this point in the history
  2. Add TODO for fixing self restriction

    Because old compiler wants this definition and CI uses old compiler...
    makenowjust authored and Brian J. Cardiff committed Mar 23, 2017
    Copy the full SHA
    8ace6d4 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #3972 from MakeNowJust/fix/crystal/self-restriction

    Fix self restriction with including generic module
    bcardiff committed Mar 23, 2017
    Copy the full SHA
    917971d View commit details
    Browse the repository at this point in the history