www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18410] New: [REG 2.079a] Conflict between overloads

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

          Issue ID: 18410
           Summary: [REG 2.079a] Conflict between overloads distinguished
                    by parameter constness
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

This code 

```
struct  Foo(T)
{
    this(T){}
    this(const T){}
}

alias S = Foo!(const int);
```

is not accepted since https://github.com/dlang/dmd/pull/7577. But curiously,

```
struct  Bar
{
    this(int){}
    this(const int){}
}
```

is still accepted.

--
Feb 09 2018