Summary: Struct instance parameterized with an Integral fails
                    as argument to functions/methods
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from Puneet Goel <> 2011-07-03 22:30:15 PDT 
struct Foo (size_t N) {
  void opAssign (size_t NN)(Foo!(NN) f) {/*do nothing*/}
struct Bar (string S) {
  void opAssign (string SS)(Bar!(SS) f) {/*do nothing*/}
void main() {
  Bar!"BAR1" bar1;
  Bar!"BAR2" bar2;
  bar2 = bar1;            // this compiles fine
  Foo!4 foo1;
  Foo!4 foo2;
  foo2 = foo1;            // compilation error

Gives an error saying:
Error: cannot implicitly convert expression (foo1) of type Foo!(4) to Foo!(NN)

Structs with string parameters work just fine.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to