Re: Does dmd not always compile all of the source code?

2017-12-07 Thread user1234 via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 19:19:09 UTC, A Guy With a Question wrote: On Wednesday, 6 December 2017 at 18:09:45 UTC, Steven Schveighoffer wrote: 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

Re: Does dmd not always compile all of the source code?

2017-12-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:07:41 UTC, A Guy With a Question wrote: Does dmd not compile all source code? It doesn't. I like to build with a few different options to explicitly test (e.g. build for Windows and Linux and -m32 and -m64 to ensure those all exercised) and for templates,

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/6/17 2:19 PM, A Guy With a Question wrote: On Wednesday, 6 December 2017 at 18:09:45 UTC, Steven Schveighoffer wrote: 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

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 19:40:49 UTC, A Guy With a Question wrote: On Wednesday, 6 December 2017 at 19:19:09 UTC, A Guy With a Question wrote: It seems D's fast compile times are achieved by skipping semantic checking and even parsing when it doesn't feel it's needed. I strongly

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 19:19:09 UTC, A Guy With a Question wrote: It seems D's fast compile times are achieved by skipping semantic checking and even parsing when it doesn't feel it's needed. I strongly disagree with this decision. This could leave complex dormant time bombs that

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 18:09:45 UTC, Steven Schveighoffer wrote: 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

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread Steven Schveighoffer via Digitalmars-d-learn
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

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:47:17 UTC, A Guy With a Question wrote: abstract class Test(T) { private: T thing; public: this(T theThing) { thing = theThing; thisdoesnotexist(); // expect compiler error right here } } ...but this compiles just fine.

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/6/17 12:04 PM, A Guy With a Question wrote: 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

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread Nick Treleaven via Digitalmars-d-learn
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

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:49:51 UTC, A Guy With a Question wrote: module grrr.grr; abstract class Test(T) { private: T thing; public: this(T theThing) { thing = theThing; thisdoesnotexist(); // expect compiler error right here } } ...but this

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:32:05 UTC, A Guy With a Question wrote: I have to be honest, I'm a little worried about all of this code I just translated and how much of it is actually valid...I hope I didn't waste my time. Ok, so I verified this much. I would expect an error from the

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:47:17 UTC, A Guy With a Question wrote: On Wednesday, 6 December 2017 at 16:32:05 UTC, A Guy With a Question wrote: I have to be honest, I'm a little worried about all of this code I just translated and how much of it is actually valid...I hope I didn't

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
I have to be honest, I'm a little worried about all of this code I just translated and how much of it is actually valid...I hope I didn't waste my time.

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:10:34 UTC, Atila Neves wrote: On Wednesday, 6 December 2017 at 16:07:41 UTC, A Guy With a Question wrote: Noticed several typos that dmd seems to have not picked up initially. Does dmd not compile all source code? I obviously wouldn't expect it to recompile

Re: Does dmd not always compile all of the source code?

2017-12-06 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:07:41 UTC, A Guy With a Question wrote: Noticed several typos that dmd seems to have not picked up initially. Does dmd not compile all source code? I obviously wouldn't expect it to recompile something unnecessarily, but in a few cases I've just seen it not

Does dmd not always compile all of the source code?

2017-12-06 Thread A Guy With a Question via Digitalmars-d-learn
Noticed several typos that dmd seems to have not picked up initially. Does dmd not compile all source code? I obviously wouldn't expect it to recompile something unnecessarily, but in a few cases I've just seen it not throw errors where it should have.