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
[broken] Support TypeQual(TypeSeq)
#16439
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
|
static assert(is(immutable(TS)[0] == immutable int)); | ||
|
||
static assert(is(const(TS) == const TS)); | ||
static assert(is(const(AliasSeq!(int, float))[0] == const int)); // OK |
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.
this line actually fails too:
compilable/type_seq_qual.d(12): Error: static assert: `is(const(int) == const(int))` is false
What is the point of an immutable |
@atilaneves AFAIK a type sequence is a type. So without an implementation of this, do you think it's better to have a special case in the type system, that only type sequences can't have a type qualifier? |
Compile-time programming is all immutable anyway. What am I missing? |
You can use the result of an
So, if it doesn't work to use type qualifiers on an This may also relate (I'm not sure) to https://issues.dlang.org/show_bug.cgi?id=24516, which shows that type qualifiers get lost when aliasing the result of |
First commit for immutable(TypeSeq) seems to work.
Second commit for const(TypeSeq) gets a bizarre result when indexed (see test).
Any ideas why/alternative suggestions?