https://issues.dlang.org/show_bug.cgi?id=17816

          Issue ID: 17816
           Summary: Casting of AliasSeq is silently ignored
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: simen.kja...@gmail.com

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.

--

Reply via email to