Skip to content

Update to Jai 0.2.029#656

Open
caztanj wants to merge 1 commit into
focus-editor:mainfrom
caztanj:jai_0.2.029
Open

Update to Jai 0.2.029#656
caztanj wants to merge 1 commit into
focus-editor:mainfrom
caztanj:jai_0.2.029

Conversation

@caztanj
Copy link
Copy Markdown
Contributor

@caztanj caztanj commented May 11, 2026

I changed the Details union to a tagged union since struct literals can no longer be used to assign values to untagged unions.

@caztanj caztanj force-pushed the jai_0.2.029 branch 3 times, most recently from 2e72bac to 445a410 Compare May 12, 2026 16:15
@obiwanus
Copy link
Copy Markdown
Collaborator

Looking good, but I haven't tested it so please let me know when you think it's ready to be merged 👍

@caztanj
Copy link
Copy Markdown
Contributor Author

caztanj commented May 13, 2026

I think it's ready now. I've used it a couple of days on macOS now and it also compiles and runs on both Windows and Linux now.

td.name = sprint("Worker thread % for queue %\0", it_index, queue);

ts := *td.ts;
set_initial_data(ts, TEMPORARY_STORAGE_SIZE, td.ts_data.data);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need to set it manually?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, apparently i forgot to check it in.


if display.base.type != Base_Display return true;

display.* = .{};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this assignment no longer work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it gives this error message:

focus/modules/Linux_Display/linux_display.jai:46,17: Error: Struct literals cannot be used to provide values for untagged unions.

    if display.base.type != Base_Display return true;
    display.* = .{};
                ^^^

focus/modules/Linux_Display/linux_display.jai:8,12: Info: Here is the type of the expression.

    }
    Display :: union {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants