← Back to index
|
Original Bugzilla link
Bug 9308 – dynamic array's TypeInfo_Array.value is null of simple basic type
Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-12T17:13:15Z
Last change time
2024-12-13T18:03:41Z
Assigned to
No Owner
Creator
egustc
Moved to GitHub: dmd#18513 →
Comments
Comment #0
by egustc — 2013-01-12T17:13:15Z
if T is a simple(without const/immutable/...) basic(int/char/bool/real/...) type, typeid(T[]).value is null. for instance: typeid(int[]).value is null, it should be typeid(int). p.s. typeid(string).value is null either. test case(tested with DMD 2.060/2.061 for Win): ---------- import std.stdio; struct FooStruct { int a; } class FooClass { int b; } enum FooEnum { fe0, fe1, fe2 } static string fooFn(string[] types...) { string r = ""; foreach(type; types) r ~= `writefln("%s\t%s\t%s\t%s", typeid(` ~type~`[]).value, typeid(immutable(`~type~`)[]).value, typeid(const(` ~type~`)[]).value, typeid(shared(`~type~`)[]).value, );`~"\n"; return r; } static auto testTypes() { return fooFn( "int", "ubyte", "char", "wchar", "real", "bool", "FooStruct", "FooClass", "FooEnum", "string", "char[]", "char[char]", ); } void main() { mixin(testTypes()); } ============= null immutable(int) const(int) shared(int) null immutable(ubyte) const(ubyte) shared(ubyte) null null const(char) shared(char) null immutable(wchar) const(wchar) shared(wchar) null immutable(real) const(real) shared(real) null immutable(bool) const(bool) shared(bool) bug.FooStruct immutable(bug.FooStruct) const(bug.FooStruct) shared(bug.FooStruct) bug.FooClass immutable(bug.FooClass) const(bug.FooClass) shared(bug.FooClass) bug.FooEnum immutable(bug.FooEnum) const(bug.FooEnum) shared(bug.FooEnum) immutable(char)[] immutable(immutable(char)[]) const(immutable(char)[]) shared(immutable(char)[]) char[] immutable(immutable(char)[]) const(const(char)[]) shared(shared(char)[]) char[char] immutable(immutable(char)[char]) const(const(char)[char]) shared(shared(char)[char])
Comment #1
by hsteoh — 2022-01-31T17:31:42Z
Problem still occurs on dmd git master 82788e4fa61082547774ef38cabef7b37f425f30 (tested on Linux/64).
Comment #2
by robert.schadek — 2024-12-13T18:03:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/18513
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB