Thread overview
what's the proper way to assign this?
Jan 04, 2022
Dr Machine Code
Jan 04, 2022
Adam D Ruppe
Jan 04, 2022
Dr Machine Code
Jan 04, 2022
Ali Çehreli
Jan 04, 2022
Dr Machine Code
January 04, 2022

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):

   	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

	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.

January 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.
January 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:
>> 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.

it's supposed to call .get implicitly then right? what made that change, assuming it worked at time. Library? compile changes?
January 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
January 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:
>> 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

a reminder to myself is check the change log first lol thanks for the link