digitalmars.D.learn - what's the proper way to assign this?
- Dr Machine Code (30/30) Jan 04 2022 I've tried to build 2 years old D project and I was getting the
- Adam D Ruppe (4/8) Jan 04 2022 This is what the original code was doing - it used to implicitly
- Dr Machine Code (3/13) Jan 04 2022 it's supposed to call .get implicitly then right? what made that
- =?UTF-8?Q?Ali_=c3=87ehreli?= (7/9) Jan 04 2022 Here is the changelog item:
- Dr Machine Code (3/13) Jan 04 2022 a reminder to myself is check the change log first lol thanks for
I've tried to build 2 years old D project and I was getting the error: > Error: cannot append type `Nullable!(SelectorEntry)` to type `SelectorEntry[]` I went to use Nullable, 'cause I've never used it before. Boiling down the error was something like (minimal code reproduction): ```d auto e = Entry("Bill", 30); auto entry = nullable(e); Entries data; data.entries ~= entry; struct Entry { string name; int id; } struct Entries { Entry[] entries; int lid; } ``` I could fix just with ```d data.entries ~= entry.get; ``` taking away all the nullables. My question is: should I use .get directly or there's a "proper way" to do it, maybe keeping the nullable? I'm asking so I don't create a misbehavior in the application.
Jan 04 2022
On Tuesday, 4 January 2022 at 17:23:11 UTC, Dr Machine Code wrote:I could fix just with ```d data.entries ~= entry.get; ```This is what the original code was doing - it used to implicitly do this. So while this might be buggy, it wouldn't be a new bug at least.
Jan 04 2022
On Tuesday, 4 January 2022 at 17:58:05 UTC, Adam D Ruppe wrote:On Tuesday, 4 January 2022 at 17:23:11 UTC, Dr Machine Code wrote:it's supposed to call .get implicitly then right? what made that change, assuming it worked at time. Library? compile changes?I could fix just with ```d data.entries ~= entry.get; ```This is what the original code was doing - it used to implicitly do this. So while this might be buggy, it wouldn't be a new bug at least.
Jan 04 2022
On 1/4/22 10:53 AM, Dr Machine Code wrote:what made that change, assuming it worked at time. Library? compile changes?Here is the changelog item: https://dlang.org/changelog/2.088.0.html#remove-nullable-alias-get-this A reminder at least to myself: I found it by searching for Nullable in the search field. I didn't know Change Log could be searched separately. Cool! :) Ali
Jan 04 2022
On Tuesday, 4 January 2022 at 19:06:52 UTC, Ali Çehreli wrote:On 1/4/22 10:53 AM, Dr Machine Code wrote:a reminder to myself is check the change log first lol thanks for the linkwhat made that change, assuming it worked at time. Library? compile changes?Here is the changelog item: https://dlang.org/changelog/2.088.0.html#remove-nullable-alias-get-this A reminder at least to myself: I found it by searching for Nullable in the search field. I didn't know Change Log could be searched separately. Cool! :) Ali
Jan 04 2022