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

remove unnecessary typeseq function #26624

Merged
merged 1 commit into from
Mar 28, 2018
Merged

remove unnecessary typeseq function #26624

merged 1 commit into from
Mar 28, 2018

Conversation

JeffBezanson
Copy link
Member

No description provided.

@@ -102,7 +102,7 @@ function typejoin(@nospecialize(a), @nospecialize(b))
vars = []
for i = 1:n
ai, bi = a.parameters[i], b.parameters[i]
if ai === bi || (isa(ai,Type) && isa(bi,Type) && typeseq(ai,bi))
if ai === bi || (isa(ai,Type) && isa(bi,Type) && ai == bi)
Copy link
Member

@Keno Keno Mar 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this now cause specialization of == on all argument types?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this call site just in case it helps, but we're inevitably going to end up calling == and isequal on types anyway. We could even consider removing the == method for types, but == would still be called and hit the fallback definition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling == on types is fine, but this function is deliberately annotated @nospecialize, so we should try to avoid having it call back into the compiler internally to avoid defeating the purpose.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't specialize functions on Type anyways, but we could mark == no-specialize too

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.

3 participants