Bug 19753 – Array ops should not need TypeInfo

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-03-19T13:02:40Z
Last change time
2019-06-01T19:52:33Z
Assigned to
No Owner
Creator
Ajieskola

Comments

Comment #0 by Ajieskola — 2019-03-19T13:02:40Z
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.
Comment #1 by n8sh.secondary — 2019-06-01T19:52:33Z
*** This issue has been marked as a duplicate of issue 19561 ***