Bug 14356 – SDC test00120.d compiles but should not
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2015-03-28T16:40:00Z
Last change time
2015-06-09T05:14:58Z
Assigned to
nobody
Creator
shammah.chancellor
Comments
Comment #0 by shammah.chancellor — 2015-03-28T16:40:10Z
SDC fails as such:
```
> ../bin/sdc test0120.d
void foo(int a) {}
^~~~~~~~~~~~~~~~~~
test0120.d:14: error: foo overrides a base class method but is not marked override
```
DMD compiles this:
```test0120.d
//T compiles:no
//T has-passed:yes
// Test implicit override error.
int main() {
return 0;
}
class A {
void foo(int a) {}
}
class B : A {
void foo(int a) {}
}
```
Comment #1 by ag0aep6g — 2015-03-28T16:56:15Z
dmd prints a deprecation message:
----
test0120.d(14): Deprecation: implicitly overriding base class method test0120.A.foo with test0120.B.foo deprecated; add 'override' attribute
----
Comment #2 by shammah.chancellor — 2015-03-28T17:00:42Z
Ah, my mistake. Thank you. I will mark this as invalid.
(In reply to ag0aep6g from comment #1)
> dmd prints a deprecation message:
> ----
> test0120.d(14): Deprecation: implicitly overriding base class method
> test0120.A.foo with test0120.B.foo deprecated; add 'override' attribute
> ----