Skip to content

Conversation

@Denneisk
Copy link
Member

@Denneisk Denneisk commented Sep 1, 2025

Creates an E2Table class because people (myself included) keep creating E2Tables wrong.

Homebrewed yet another E2 type inferrer because I didn't want to look in E2Lib for one.

Implements most of #2817

Fixes #3410

I had most of this code just lying around since late-2023 and... blehhh :PP

@Astralcircle
Copy link
Contributor

This probably can break compact with some E2 extensions, what do you think about it?
image

@Denneisk
Copy link
Member Author

Denneisk commented Sep 2, 2025

Everything's backwards-compatible. That function still exists and will create a normal empty table object. I just swapped the references for minor performance reasons and housekeeping.

Normal E2 table building (setting every part manually) works by default since the underlying table object is unchanged.

--- Deprecated. Creates an empty `E2Table`. Use `E2Lib.E2Table` or `E2Lib.E2Table.New` instead.
---@see E2Table
---@deprecated
local function newE2Table_compat()
return newE2Table()
end
E2Lib.newE2Table = newE2Table_compat -- Deprecated, backwards compat

@Denneisk
Copy link
Member Author

Denneisk commented Sep 2, 2025

Agh but I'd have to move this into WireLib since that depends on E2 tables...

@Astralcircle
Copy link
Contributor

Everything's backwards-compatible. That function still exists and will create a normal empty table object. I just swapped the references for minor performance reasons and housekeeping.

Normal E2 table building (setting every part manually) works by default since the underlying table object is unchanged.

--- Deprecated. Creates an empty `E2Table`. Use `E2Lib.E2Table` or `E2Lib.E2Table.New` instead.
---@see E2Table
---@deprecated
local function newE2Table_compat()
return newE2Table()
end
E2Lib.newE2Table = newE2Table_compat -- Deprecated, backwards compat

Oops, didn't notice

@Astralcircle
Copy link
Contributor

Is this still in progress?

@Denneisk
Copy link
Member Author

Nobody clarified if I should move this from E2Lib to WireLib, so I'll just make that decision myself and move it there myself.

@Astralcircle Astralcircle merged commit 419ebfd into wiremod:master Sep 14, 2025
1 check failed
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.

Spawning an Constant Value with E2 sentSpawn can permanently break the debugger

2 participants