www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5253] New: regression, in contracts are not allowed in overriden methods.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5253

           Summary: regression, in contracts are not allowed in overriden
                    methods.
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: baryluk smp.if.uj.edu.pl


--- Comment #0 from Witold Baryluk <baryluk smp.if.uj.edu.pl> 2010-11-21
18:27:41 PST ---
Minimal test case:

module strange_override_bug;

interface K {
    void f();
}

class A(int m) : K {
    override void f()
    in { }
    body { }
}

class B : A!(2) {
    void f() { }
}

/*
strange_override_bug.d(8): Error: variable strange_override_bug.A!(2).A.f.this
override cannot be applied to variable
strange_override_bug.d(9): Error: function
strange_override_bug.A!(2).A.f.__require override only applies to class member
functions
*/

Compile with "in { }" line commented out!
Compiles also if i remove "override" keyword" (and it do not warn my about
anything).

Was working in 2.049.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 21 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5253



--- Comment #1 from Witold Baryluk <baryluk smp.if.uj.edu.pl> 2010-11-21
18:50:07 PST ---
'int m' parameter in template is also important. Minimizing test case by
removing it, make error disappear. Changing it to general template parameter
(i.e. class A(T) : K) , also makes error disappear.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 21 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5253


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |DUPLICATE


--- Comment #2 from Don <clugdbug yahoo.com.au> 2010-11-22 07:01:01 PST ---
*** This issue has been marked as a duplicate of issue 5145 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 22 2010