Bug 17816 – Casting of AliasSeq is silently ignored

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2017-09-07T13:54:11Z
Last change time
2020-05-28T12:30:42Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
Simen Kjaeraas

Comments

Comment #0 by simen.kjaras — 2017-09-07T13:54:11Z
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 by simen.kjaras — 2020-05-28T12:30:42Z
Fixed in 2.086.1