On 12/6/17 12:17 PM, Steven Schveighoffer wrote:

So why wouldn't the compiler fail? Because it has no idea yet what you mean by Nullable. It doesn't even know if Nullable will be available or not. You could even import Nullable, but Nullable!T may be an error.

To give an example of why the compiler waits until instantiation:

class C(T) : T
{
   void foo() { doesthisexist(); }
}

class D { void doesthisexist(); }

auto x = new C!D; // OK
auto y = new C!Object: // fail

-Steve
  • Does dmd not always compile ... A Guy With a Question via Digitalmars-d-learn
    • Re: Does dmd not always... Atila Neves via Digitalmars-d-learn
      • Re: Does dmd not al... A Guy With a Question via Digitalmars-d-learn
        • Re: Does dmd no... A Guy With a Question via Digitalmars-d-learn
          • Re: Does dm... A Guy With a Question via Digitalmars-d-learn
            • Re: Do... A Guy With a Question via Digitalmars-d-learn
              • Re... A Guy With a Question via Digitalmars-d-learn
                • ... Nick Treleaven via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... A Guy With a Question via Digitalmars-d-learn
                • ... A Guy With a Question via Digitalmars-d-learn
                • ... Atila Neves via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... user1234 via Digitalmars-d-learn
            • Re: Do... Gary Willoughby via Digitalmars-d-learn
    • Re: Does dmd not always... Adam D. Ruppe via Digitalmars-d-learn

Reply via email to