[Issue 9514] "template instance … is not an alias"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 15 08:53:14 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9514



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2013-02-15 08:53:11 PST ---
This problem had occured by this commit:
Revision: de4f8f6bf8dc9fcc1730ea4d7f2bbd3e74880f08
Message:
Merge pull request #1543 from 9rnsr/fix5933

Issue 5933 & 7159 & 9377 - Invoke function semantic3 correctly where it is
required.

----
Fix-up way for thrift code is:

In thrift/libe/d/src/thrift/codegen/base.d
version (unittest) {
  // Cannot make this nested in the unittest block due to a »no size yet for
  // forward reference« error.
  struct Foo { //----> Move Foo into unittest with changing to `static struct`
    string a;
    int b;
    int c;

    mixin TStructHelpers!([
      TFieldMeta("a", 1),
      TFieldMeta("b", 2, TReq.OPT_IN_REQ_OUT),
      TFieldMeta("c", 3, TReq.REQUIRED, "4")
    ]);
  }
}

----
I think this is not a compiler issue.

Before the compiler change, a member template function call had not run its
semantic3 in some case. It was wrong for auto return type inference and
attribute inference feature, but at the same time it had accidentally deferred
some forward reference error. In past std.numeric module has such a hidden
forward reference bug, and I had fixed it for compiler. 
Even worse thing, fixing such a bug is sometimes much difficult. If a template
member function is tested inside template constraint, the actual error messages
will be gagged.

Note: workaround pull for std.numeric module.
https://github.com/D-Programming-Language/phobos/pull/1096

Let's back to the Thrift code issue. This is just my prediction, the Foo
declaration contains "mixin TStructHelpers!(...)", and it may have some forward
reference error as like explained above.

David Nadlinger, You have control.

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


More information about the Digitalmars-d-bugs mailing list