Bug 11896 – [REG2.066a] isVirtualMethod related GitHub HEAD regression (works with 2.064)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-10T09:14:00Z
Last change time
2014-01-22T18:18:58Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
puneet

Comments

Comment #0 by puneet — 2014-01-10T09:14:05Z
Here is the reduced testcase. With the GitHub HEAD DMD I get: $ dmd -c test.d test.d(8): Error: function test.foo!int.foo.bar () is not callable using argument types (foo!int) test.d(12): Error: template instance test.foo!int error instantiating // File test.d class foo(T = int) { static if(! __traits(isVirtualMethod, zoo)) {} alias foo!(T) foobar; static foobar _bar; static foobar bar() {return _bar;} static void bar(foobar foo) {_bar = foo;} static foobar zoo() { bar = new foobar; return bar; } } foo!(int) baz;
Comment #1 by bugzilla — 2014-01-12T13:04:53Z
Reduced test case: class foo(T = int) { static if(! __traits(isVirtualMethod, zoo)) {} static void bar(); static void bar(foo foo); static void zoo() { bar(new foo); } }
Comment #2 by bugzilla — 2014-01-12T13:06:46Z
The issue revolves around traits doing a forward reference of zoo().
Comment #3 by k.hara.pg — 2014-01-12T17:54:57Z
(In reply to comment #2) > The issue revolves around traits doing a forward reference of zoo(). It's introduced by fixing issue 10329 https://github.com/D-Programming-Language/dmd/commit/ebae884d9cd3a0c4ebf3c1b129654ba31ee0e73f Merge pull request #2832 from 9rnsr/fix10329 But, the commit does not exist in 2.065 branch, so it is git-head only regression.
Comment #4 by bugzilla — 2014-01-12T21:46:54Z
The only problem there is 2.065 is in such a confused state that I'd prefer to just abandon it and go with 2.066, meaning this needs to be either fixed or reverted. Of course, I'd prefer fixing it!
Comment #5 by k.hara.pg — 2014-01-13T01:13:13Z
Comment #6 by github-bugzilla — 2014-01-13T02:24:17Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/474a7a2e422c4342d0301d30e21341a7b05e221c fix Issue 11896 - isVirtualMethod related GitHub HEAD regression (works with 2.064) https://github.com/D-Programming-Language/dmd/commit/7f69836080025e931ef7c18d9693c3718c42b8bd Merge pull request #3088 from 9rnsr/fix11896 [REG2.066a] Issue 11896 - isVirtualMethod related GitHub HEAD regression (works with 2.064)
Comment #7 by puneet — 2014-01-13T04:40:11Z
Another reduced test case. // test.d Frop!(int) frop; mixin template baz() { public void bar() {} } mixin baz; class Foo(T) { static if(! __traits(isVirtualMethod, zoo)) {} static void zoo() { bar(); } } class Frop(T): Foo!T {} void main() { frop.zoo(); }
Comment #8 by puneet — 2014-01-15T06:45:01Z
Yet another reduced testcase. This results in breaking my code at runtime since the constructor is given a skip with GitHub HEAD! class Bar {} class Foo(T=Bar) { static if(! __traits(isVirtualMethod, foo)) {} alias Foo!(T) this_type; this() { import std.stdio; writeln("Call to constructor -- GitHub HEAD skips this"); } static public this_type foo() { return new this_type(); } } void main() { alias Foo!Bar FooBar; FooBar.foo(); }
Comment #9 by k.hara.pg — 2014-01-15T09:14:06Z
Comment #10 by puneet — 2014-01-15T09:41:36Z
(In reply to comment #9) > https://github.com/D-Programming-Language/dmd/pull/3104 Works for me.
Comment #11 by github-bugzilla — 2014-01-15T20:03:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a9769a205c47aa5960e78fea4ce26a312a2b6cde fix Issue 11896 - isVirtualMethod related GitHub HEAD regression (works with 2.064) https://github.com/D-Programming-Language/dmd/commit/8409d8c25734f9569a687b18f8a4818ee5762775 Merge pull request #3104 from 9rnsr/fix11896 [REG2.065a] Issue 11896 - isVirtualMethod related GitHub HEAD regression (works with 2.064)
Comment #12 by github-bugzilla — 2014-01-22T18:18:58Z
Commit pushed to release at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/20c684c15c670882555e530b693dd8529e744060 Merge pull request #3104 from 9rnsr/fix11896 [REG2.065a] Issue 11896 - isVirtualMethod related GitHub HEAD regression (works with 2.064)