D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10768 - DMD does not show deprecation message for missing 'override' keyword
Summary: DMD does not show deprecation message for missing 'override' keyword
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2013-08-06 21:33 UTC by Kenji Hara
Modified: 2013-08-28 14:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2013-08-06 21:33:32 UTC
This is a spin-off issue from:
http://d.puremagic.com/issues/show_bug.cgi?id=10727#c3

----

DMD does not crib about
missing override for function Foo.frop. But starts doing that if "alias toArray
this" in CirBuff(T) is commented out.

struct CirBuff(T) {
  import std.traits: isArray;
  CirBuff!T opAssign(R)(R ) if(isArray!R) { }

  T[] toArray() {
    T[] ret; //  = new T[this.length];
    return ret;
  }
  alias toArray this;
}

class Bar (T=int){
  CirBuff!T _bar;
}

class Once {
  Bar!Foo _foobar;
}

class Foo: Frop {
  // override
  public int frop() {return 1;}
}

class Frop {
  public int frop() {return 0;}
}
Comment 2 github-bugzilla 2013-08-28 14:34:39 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8221f864ff23aa9ff92b9edb8f73ced08cbe6506
fix Issue 10768 - DMD does not show deprecation message for missing 'override' keyword

If a class/struct/template is not speculatively instantiated, error gagging should be ungagged temporarily during its semantic.
Use RAII idiom to do it reliably.

https://github.com/D-Programming-Language/dmd/commit/3088fa094d1d7834b5e1a9285a4b076013341150
Merge pull request #2453 from 9rnsr/fix10768

Issue 10768 - DMD does not show deprecation message for missing 'override' keyword