Summary: D2 Language Docs:
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2

--- Comment #0 from Andrej Mitrovic <> 2010-08-01 
14:48:02 PDT ---
"Function Inheritance and Overriding"

The 4th example is trying to import std.hiddenfunc. The compiler can't find
that file (I'm guessing this was moved someplace else). This will need

"Overload Sets"

There are three code example modules here:

module A;
void foo() { }
void foo(long i) { }

module B;
class C { }
void foo(C) { }
void foo(int i) { }

import A;
import B;

void bar(C c)
    foo();    // calls
    foo(1L);  // calls
    foo(c);   // calls
    foo(1,2); // error, does not match any foo
    foo(1);   // error, matches and; // calls

I am getting an additional error on line:

new.d(7): Error: at B.d(4) conflicts with at A.d(3) and conflict when passing long as an argument. But
seeing as calling them with an int will conflict as well, I expect this to be
the normal behavior. If that is so, change that line to:

foo(1L);  // error, matches and

Title: "Typesafe variadic functions"

In the third example, change these lines:

Foo g = new Foo(3, "abc");
test(1, 4, "def");


Foo g = new Foo(3, "abc".dup);
test(1, 4, "def".dup);

for the example to compile.

"Local Variables"

"It is an error to use a local variable without first assigning it a value."

This sounds like C semantics to me. But D has all of its local variables
initialized to their default values, so I'm not sure what this statement means.

"It is an error to declare a local variable that
is never referred to."

I've never had such an error and neither a warning. Can someone elaborate?

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

Reply via email to