[Issue 22050] New: -betterC silent crash when compiling map returning string

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 20 07:07:47 UTC 2021


          Issue ID: 22050
           Summary: -betterC silent crash when compiling map returning
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: mipri at minimaltype.com

This program fails to compile with no output from dmd:

import std.algorithm, std.range, std.conv;

void foo() {
    assert(2 == iota(2).map!(n => to!string(n)).length);

Shell session:

$ dmd -c bclife.d || echo failed
$ dmd -betterC -c bclife.d || echo failed
$ dmd -betterC -c bclife.d -v |tail -1
import    core.internal.lifetime       

This behavior is seen also with a just-compiled devel dmd.

s/string/float/ and it's fine.

it silently crashes elsewhere with "".dup instead of to!string(n):

semantic2 bclife3
semantic3 bclife3
import    core.stdc.string     

Most other variations that I've tried hit expected betterC errors.


More information about the Digitalmars-d-bugs mailing list