[Issue 19753] New: Array ops should not need TypeInfo

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 19 13:02:40 UTC 2019


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

          Issue ID: 19753
           Summary: Array ops should not need TypeInfo
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: major
          Priority: P3
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: Ajieskola at gmail.com

The following snippet does not compile with the -betterC flag:

```
__gshared int[2] a = [5, 5];
__gshared int[2] b = [7, 5];
__gshared int[2] c;
extern (C) export void _start(){c[] = a[] + b[];}
```

Error message (with both dmd 2.085.0 ldc 1.14.0) is `[compiler import
path]\druntime\import\object.d(4502): Error: TypeInfo cannot be used with
-betterC`. By removing the array addition operation, this example compiles.

Unless I'm mistaken, the program should not need runtime type information to
perform an array operation like this, and thus it should be doable in better C
mode.

--


More information about the Digitalmars-d-bugs mailing list