On Wednesday, 6 December 2017 at 17:04:06 UTC, A Guy With a Question wrote:
abstract class Test(T)

Here you have a class template.

It does produce there error when I do this:

class Test2
   : Test!int

You instantiated the template, so the compiler can now type check the instantiated class.

class Test
   : ITest!int

Same thing here but with an interface template.

I really do think, regardless of if this is considered a template expansion, that dmd should be catching these obvious errors. When one writes interfaces and abstract classes they are generally not ready to implement the end class yet. And getting a ton of errors at once when that occurs is really hard to deal with. I really don't understand why the compiler would have issues with this.

I sympathize, something like Rust's traits or concept-enhanced C++ could probably do what you want, but D doesn't have this feature.
  • 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