Fix Issue 16611 - 'Unrecognized type const(void)' error for std.trait…#4916
Fix Issue 16611 - 'Unrecognized type const(void)' error for std.trait…#4916andralex merged 1 commit intodlang:masterfrom
Conversation
|
|
Please add one or more unittests testing this code path. |
There was a problem hiding this comment.
However I am not sure if this is the right approach. In theory shouldn't "const(void)" be caught by isBasicType ? Should I edit this one instead to check for const(void) as well ?
IMO, the correct fix, is to change isBasicType to:
enum bool isBasicType(T) = isScalarType!T || is(Unqual!T == void);
That would entail, adding a unittest to isBasicType for isBasicType!(const void), isBasicType!(shared void), etc. and then adding a tests to fullyQualifiedName for T == const(void) and friends.
|
It's a little weird that you can create a type like |
|
@MetaLang need it for declaring appropriate void arrays: |
|
Ah, for some reason I thought that was a separate case. |
fd89d03 to
26f3f16
Compare
|
@ZombineDev @MetaLang Implemented the modifications you suggested. Should be ready for merge once all tests pass. |
| static assert(fqn!(dstring) == "dstring"); | ||
| static assert(fqn!(void) == "void"); | ||
| static assert(fqn!(const(void)) == "const(void)"); | ||
| static assert(fqn!(shared(void)) == "shared(void)"); |
There was a problem hiding this comment.
Can you also add tests for the following qualifiers:
shared const void
shared inout void
shared inout const void
inout void
inout const void
immutable void| static assert(isBasicType!void); | ||
| static assert(isBasicType!(const(void))); | ||
| static assert(isBasicType!(shared(void))); | ||
| static assert(isBasicType!(immutable(void))); |
…s.fullyQualifiedName
26f3f16 to
a636bb6
Compare
PetarKirov
left a comment
There was a problem hiding this comment.
Thanks, @Darredevil! With that everything LGTM.
|
LGTM |
…s.fullyQualifiedName
https://issues.dlang.org/show_bug.cgi?id=16611