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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GenericClassType vs GenericClassInstanceType restrictions #7537

Conversation

Projects
None yet
4 participants
@bew
Copy link
Contributor

commented Mar 11, 2019

I can't find an issue this may have solved (hard to search!), but basically:

class Foo(T)
end

def bar(a : Foo)
  1
end

def bar(a : Foo(Int32))
  true
end

# Before:
bar(Foo(Int32).new) # => 1

# After
bar(Foo(Int32).new) # => true

馃帀

@asterite

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

I'll review it tomorrow.

@asterite
Copy link
Member

left a comment

Looks really good! Thank you!

@asterite asterite added this to the 0.28.0 milestone Mar 12, 2019

@asterite asterite merged commit 3cecde5 into crystal-lang:master Mar 12, 2019

4 of 5 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
ci/circleci: check_format Your tests passed on CircleCI!
Details
ci/circleci: test_darwin Your tests passed on CircleCI!
Details
ci/circleci: test_linux Your tests passed on CircleCI!
Details
ci/circleci: test_linux32 Your tests passed on CircleCI!
Details
@straight-shoota

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

@asterite Your announcement to review tomorrow would have been almost true in CET, just off by 2 minutes... 馃槅

@bew

This comment has been minimized.

Copy link
Contributor Author

commented Mar 13, 2019

Cool, thanks for the review and merge 馃槂

@bew bew deleted the bew:bugfix/fix-GenericClassType-vs-GenericClassInstanceType-restrictions branch Mar 13, 2019

@asterite

This comment has been minimized.

Copy link
Member

commented Mar 13, 2019

@straight-shoota Haha, yes. I commented that but then realized I had time to do it then... but I figured maybe what I said is true in some timezone out there :-P

urde-graven pushed a commit to urde-graven/crystal that referenced this pull request Mar 20, 2019

Urde Graven
Merge branch 'master' of github.com:crystal-lang/crystal
* 'master' of github.com:crystal-lang/crystal:
  Change the font-weight used in Playground (crystal-lang#7552)
  Fix formatting absolute paths (crystal-lang#7560)
  Refactor IO::Syscall as IO::Evented (crystal-lang#7505)
  YAML: fix test checking serialization of slices for libyaml 0.2.2 (crystal-lang#7555)
  Let Array#sort only use `<=>`, and let `<=>` return `nil` for partial comparability (crystal-lang#6611)
  Update `to_s` and `inspect` to have similar signatures accross the stdlib (crystal-lang#7528)
  Fix restriction of valid type vs free vars (crystal-lang#7536)
  Rewrite macro spec without executing a shell command (crystal-lang#6962)
  Suggest `next` when trying to break from captured block  (crystal-lang#7406)
  Fix GenericClassType vs GenericClassInstanceType restrictions (crystal-lang#7537)
  Add human readable formatting for numbers (crystal-lang#6314)
  Add command and args to execvp error message (crystal-lang#7511)
  Implement Set#add? method (crystal-lang#7495)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.