www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23302] New: std.algorithm.comparison.predSwitch producing


          Issue ID: 23302
           Summary: std.algorithm.comparison.predSwitch producing
                    SwitchError with error message as the filename
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: artha samerion.com

In this example
import std.algorithm;

void main() 

            1, "Hello, World!"

The following SwitchError will be thrown:
core.exception.SwitchError Input not matched by any pattern(1968): No
appropriate switch clause found
Incorrectly, predSwitch supplies the error message into the filename parameter.
This likely happens because SwitchError does not take a message parameter (see:

Found with a DMD64 D Compiler v2.100.0 on Linux

Aug 22 2022