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

Improve type stability of Image constructor #393

Merged
merged 1 commit into from
Nov 3, 2015

Conversation

mbauman
Copy link
Contributor

@mbauman mbauman commented Nov 2, 2015

Inference is run before the inlining pass, so when inference runs on constructors of the form T{ndims(A)}(...), it does't see the inlined constant; it just sees an Int. The fix is to just use the type parameters directly. I've added this as an additional constructor to make sure it doesn't break any existing code with very poorly typed arrays.

Inference is run before the inlining pass, so when inference runs on constructors of the form `T{ndims(A)}(...)`, it does't see the inlined constant; it just sees an Int.  The fix is to just use the type parameters directly.  I've added this as an additional constructor to make sure it doesn't break any existing code with very poorly typed arrays.
@mbauman
Copy link
Contributor Author

mbauman commented Nov 2, 2015

Aha, I just noticed #370, which was reverted due to Windows failures. Looking at the AppVeyor logs there, it failed due to a missing method for the Image constructor. Unlike #370, this keeps the old constructor around, so it will still work even in the absence of good typing. AppVeyor already passed once, and I re-ran it just to make sure.

(Interesting that inference behaved differently on Windows in #370, though…)

@timholy
Copy link
Member

timholy commented Nov 3, 2015

Hey, that's great! Interesting that neither the author of #370 nor myself thought of keeping the old one around as a backup. 👍

timholy added a commit that referenced this pull request Nov 3, 2015
Improve type stability of Image constructor
@timholy timholy merged commit d960a1c into JuliaImages:master Nov 3, 2015
timholy added a commit that referenced this pull request Nov 3, 2015
Tests that the fix in #393 covers #356
@timholy timholy mentioned this pull request Nov 3, 2015
@mbauman mbauman deleted the mb/stability branch November 3, 2015 13:42
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.

2 participants