D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17816 - Casting of AliasSeq is silently ignored
Summary: Casting of AliasSeq is silently ignored
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 All
: P1 minor
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2017-09-07 13:54 UTC by Simen Kjaeraas
Modified: 2020-05-28 12:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Simen Kjaeraas 2017-09-07 13:54:11 UTC
import std.meta : AliasSeq;
    AliasSeq!(float) a;
    auto b = cast(int)a;
    static assert(is(typeof(b[0]) == float));

The above assert passes. I would argue the cast is nonsensical and should result in a compilation failure, though an argument could be presented for casting all elements to int. Neither of these happen with the current compiler.
Comment 1 Simen Kjaeraas 2020-05-28 12:30:42 UTC
Fixed in 2.086.1