[Issue 19107] New: -de produces compilation error, -dw does not

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 22 10:40:04 UTC 2018


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

          Issue ID: 19107
           Summary: -de produces compilation error, -dw does not
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: slavo5150 at yahoo.com

--- sing.d
module sing;

alias I(alias A) = A;


--- git.d
import sing : I;


--- manager.d
module manager;

import std.algorithm;
import std.range;
import git;

class DManager
{
    struct Config
    {
        struct Build
        {
            struct Components
            {
                string[] getEnabledComponentNames()
                {
                    return null;
                }
            }
            Components components;
        }
        Build build;
    }
    Config config;

    void getCacheState(string[string] history)
    {
        auto componentNames = config.build.components.getEnabledComponentNames;
        auto components = componentNames.map!(componentName => componentName);

        components
        .map!(component => component)
        .map!(componentName => componentName);

        foreach (submoduleCommits; history)
        {
            componentNames.all!(componentName => componentName.I!(component =>
component));
        }
    }
}

$ dmd -c -dw manager.d
OK

$ dmd -c -de manager.d
manager.d(37): Error: template
manager.DManager.getCacheState.__foreachbody5.all!((componentName) =>
componentName.I!((component) => component)).all cannot deduce function from
argument types !()(string[]), candidates are:
/usr/include/dlang/dmd/std/algorithm/searching.d(122):       
manager.DManager.getCacheState.__foreachbody5.all!((componentName) =>
componentName.I!((component) => component)).all(Range)(Range range) if
(isInputRange!Range && is(typeof(unaryFun!pred(range.front))))

Currently blocking progress on https://github.com/dlang/dmd/pull/8443

--


More information about the Digitalmars-d-bugs mailing list