Super easy struct construction question that I'm embarrassed to ask.

An home at home.com
Fri Jan 10 16:57:10 UTC 2025


On Thursday, 9 January 2025 at 22:08:31 UTC, Dennis wrote:
> On Thursday, 9 January 2025 at 22:01:59 UTC, WhatMeWorry wrote:
>>     this(Location locaction, uint f) {
>>         this.location = location;
>>         this.f = f;
>>     }
>
>
> You misspelled the parameter name 'locaction', so your 
> assignment in the constructor is a no-op:
>
> ```
> this.location = this.location
> ```

If the compiler flags this as an warning -> he probably notice 
the problem
Lag of error/warn/hint for such case is not helping
Happy coding


More information about the Digitalmars-d-learn mailing list