alias to connect with superclass's constructor

2025-04-05 Thread Andy Valencia via Digitalmars-d-learn
Consider the following, totally contrived, code. The compiler tells me: tst39.d(21): Error: constructor `tst39.B.this(string s)` is not callable using argument types `()` tst39.d(21):constructor `tst39.B.this` hides base class function `tst39.A.this` tst39.d(21):add `alias thi

Re: alias to connect with superclass's constructor

2025-04-04 Thread Nick Treleaven via Digitalmars-d-learn
On Sunday, 23 March 2025 at 05:40:32 UTC, Jonathan M Davis wrote: On Saturday, March 22, 2025 11:38:05 AM MDT Paul Backus via Digitalmars-d-learn wrote: On Saturday, 22 March 2025 at 12:05:11 UTC, Ali Çehreli wrote: > On 3/21/25 8:35 PM, Andy Valencia wrote: > > > tst39.d(21):add `alias

Re: alias to connect with superclass's constructor

2025-03-26 Thread Menjanahary R. R. via Digitalmars-d-learn
On Sunday, 23 March 2025 at 05:40:32 UTC, Jonathan M Davis wrote: On Saturday, March 22, 2025 11:38:05 AM MDT Paul Backus via Digitalmars-d-learn wrote: On Saturday, 22 March 2025 at 12:05:11 UTC, Ali Çehreli wrote: > On 3/21/25 8:35 PM, Andy Valencia wrote: > > > tst39.d(21):add `alias

Re: alias to connect with superclass's constructor

2025-03-24 Thread Andy Valencia via Digitalmars-d-learn
On Monday, 24 March 2025 at 03:46:25 UTC, Salih Dincer wrote: When you add an empty constructor, the code still runs without an error Yes, I had already made it run. I was asking about making it run using aliases which, as it turns out, you can't. I'm grateful that there's even a PR in the

Re: alias to connect with superclass's constructor

2025-03-23 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 22 March 2025 at 03:35:35 UTC, Andy Valencia wrote: Consider the following, totally contrived, code. The compiler tells me: tst39.d(21): Error: constructor `tst39.B.this(string s)` is not callable using argument types `()` tst39.d(21):constructor `tst39.B.this` hides base

Re: alias to connect with superclass's constructor

2025-03-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, March 22, 2025 11:38:05 AM MDT Paul Backus via Digitalmars-d-learn wrote: > On Saturday, 22 March 2025 at 12:05:11 UTC, Ali Çehreli wrote: > > On 3/21/25 8:35 PM, Andy Valencia wrote: > > > > > tst39.d(21):add `alias this = tst39.A.this` to > > `tst39.B`'s body > > > to merge

Re: alias to connect with superclass's constructor

2025-03-22 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 22 March 2025 at 12:05:11 UTC, Ali Çehreli wrote: On 3/21/25 8:35 PM, Andy Valencia wrote: > tst39.d(21):add `alias this = tst39.A.this` to `tst39.B`'s body > to merge the overload sets Yeah, that doesn't work. Perhaps a regression... It's never worked. The error message

Re: alias to connect with superclass's constructor

2025-03-22 Thread Ali Çehreli via Digitalmars-d-learn
On 3/21/25 8:35 PM, Andy Valencia wrote: > tst39.d(21):add `alias this = tst39.A.this` to `tst39.B`'s body > to merge the overload sets Yeah, that doesn't work. Perhaps a regression... > I _can_ add this to B: > > ```d > this() { > super(): > } > ``` And then it's mo

Re: alias to connect with superclass's constructor

2025-03-22 Thread monkyyy via Digitalmars-d-learn
On Saturday, 22 March 2025 at 03:35:35 UTC, Andy Valencia wrote: Consider the following, totally contrived, code. The compiler tells me: tst39.d(21): Error: constructor `tst39.B.this(string s)` is not callable using argument types `()` tst39.d(21):constructor `tst39.B.this` hides base