On Wednesday, 15 August 2018 at 08:14:53 UTC, Petar Kirov
[ZombineDev] wrote:
It's not a bug, it's all about how the type system is set up.
The type of an array literal expression like `[1, 2, 3]` is
`int[]` (a slice of an array of ints), so no matter if you do:
auto readonly(T)(const(T)[]
On Wednesday, 15 August 2018 at 08:14:53 UTC, Petar Kirov
[ZombineDev] wrote:
https://run.dlang.io/is/iD9ydu
I made a typo in one of the comments. Here's the fixed version:
https://run.dlang.io/is/HRqYcZ
On Tuesday, 14 August 2018 at 17:49:32 UTC, Mike Franklin wrote:
On Tuesday, 14 August 2018 at 17:22:42 UTC, Seb wrote:
FYI: staticArray will be part of 2.082, it already works with
dmd-nightly:
That just seems wrong. Isn't the fact that `staticArray` is
needed a bug in the compiler? I
On Tuesday, 14 August 2018 at 17:22:42 UTC, Seb wrote:
FYI: staticArray will be part of 2.082, it already works with
dmd-nightly:
That just seems wrong. Isn't the fact that `staticArray` is
needed a bug in the compiler? I think the compiler could have
lowered to something like that
On Tuesday, 14 August 2018 at 16:31:38 UTC, Paul Backus wrote:
On Tuesday, 14 August 2018 at 13:01:57 UTC, learnfirst1 wrote:
enum string[] a = ["a"];
extern(C) void main() {
int i = 0;
auto s = a[i];
}
---
Error: TypeInfo cannot be used with -betterC
Workaround:
On Tuesday, 14 August 2018 at 13:01:57 UTC, learnfirst1 wrote:
enum string[] a = ["a"];
extern(C) void main() {
int i = 0;
auto s = a[i];
}
---
Error: TypeInfo cannot be used with -betterC
Workaround: https://run.dlang.io/is/NZykl0
Source:
On Tuesday, 14 August 2018 at 13:01:57 UTC, learnfirst1 wrote:
enum string[] a = ["a"];
extern(C) void main() {
int i = 0;
auto s = a[i];
}
---
Error: TypeInfo cannot be used with -betterC
You can use `static immutable` as a workaround for now:
On Tuesday, 14 August 2018 at 13:16:50 UTC, Nicholas Wilson wrote:
On Tuesday, 14 August 2018 at 13:01:57 UTC, learnfirst1 wrote:
enum string[] a = ["a"];
extern(C) void main() {
int i = 0;
auto s = a[i];
}
---
Error: TypeInfo cannot be used with -betterC
Yes.
On Tuesday, 14 August 2018 at 13:01:57 UTC, learnfirst1 wrote:
enum string[] a = ["a"];
extern(C) void main() {
int i = 0;
auto s = a[i];
}
---
Error: TypeInfo cannot be used with -betterC
Yes. https://issues.dlang.org/show_bug.cgi?id=19169
enum string[] a = ["a"];
extern(C) void main() {
int i = 0;
auto s = a[i];
}
---
Error: TypeInfo cannot be used with -betterC
10 matches
Mail list logo