Re: Class-Inheritancing Error

2025-07-28 Thread David T. Oxygen via Digitalmars-d-learn
On Monday, 28 July 2025 at 18:02:45 UTC, H. S. Teoh wrote: On Sun, Jul 27, 2025 at 05:02:35PM +, user1234 via Digitalmars-d-learn wrote: [...] Simply because because if OP writes ``` class Person{ string name; this(string name){this.name=name;} } class Someone:Person{ } void main(){

Re: Class-Inheritancing Error

2025-07-28 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Jul 27, 2025 at 05:02:35PM +, user1234 via Digitalmars-d-learn wrote: [...] > Simply because because if OP writes > > ``` > class Person{ > string name; > this(string name){this.name=name;} > } > class Someone:Person{ > } > void main(){ > Someone x=new Someone("Bob"); > }

Re: Class-Inheritancing Error

2025-07-27 Thread user1234 via Digitalmars-d-learn
On Sunday, 27 July 2025 at 15:14:03 UTC, H. S. Teoh wrote: On Sun, Jul 27, 2025 at 11:08:33AM +, David T. Oxygen via Digitalmars-d-learn wrote: I wrote a piece of code like this: ```d class Person{ string name; this(string name){this.name=name;} } class Someone:Person{

Re: Class-Inheritancing Error

2025-07-27 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Jul 27, 2025 at 11:08:33AM +, David T. Oxygen via Digitalmars-d-learn wrote: > I wrote a piece of code like this: > > ```d > class Person{ > string name; > this(string name){this.name=name;} > } > class Someone:Person{ > alias super this; > } > void main(){ > S