-
Notifications
You must be signed in to change notification settings - Fork 706
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
codegen: Do the same workaround we do for template parameters with typename
on aliases for decltypes
we can't resolve.
#384
Conversation
Actually, fitzgen was on vacation IIRC, want to review this @nox? |
inner_canon_type.name().map_or(false, |name| { | ||
name.contains("decltype ") || | ||
name.contains("decltype(") | ||
}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never have any spaces or parens for named types, regardless of decltype or typename.
What we want here is a generic check that this named type is a valid C++ identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree with this. My thinking was that given this is the exception, and not the norm, I think we want to know when can we generate these incorrect bits before skipping them.
I'm fine tweaking this to be a generic identifier check though, I guess.
☔ The latest upstream changes (presumably #414) made this pull request unmergeable. Please resolve the merge conflicts. |
@emilio were you going to circle back to this? |
We do the same for template parameters with `typename` on aliases. This is not great, but it's better than generating invalid code.
Whoops, forgot about this, there you go :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
} | ||
_ => false, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to have a small #[test]
unit test, or a doc test. Just for sanity.
Ok as a follow up, or as an issue marked E-Easy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with your decision on what to do about ^
@bors-servo r=fitzgen Will open an |
📌 Commit f4d4994 has been approved by |
⚡ Test exempted - status |
codegen: Do the same workaround we do for template parameters with `typename` on aliases for `decltypes` we can't resolve. r? @fitzgen
r? @fitzgen