www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17893] New: [REG 2.076.1] contract in templatized final class

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

          Issue ID: 17893
           Summary: [REG 2.076.1] contract in templatized final class
                    require nothrow
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

test case:

---
final class Foo(T)
{
    void bar()
    in
    {
        import std.algorithm.iteration: reduce;
        auto b = [0].reduce!((a,b) => a + b);
    }
    body
    {
    }
}

Foo!int foo;
---

compiles if A or B or C:

A. code is not in contract
B. Foo is not final
C. Foo is not a template

--
Oct 11 2017