Skip to content

fix(schema): wrap IfcArcIndex/IfcLineIndex indices as IfcPositiveInteger#2042

Open
beachtom wants to merge 1 commit into
mainfrom
ISSUE_1881
Open

fix(schema): wrap IfcArcIndex/IfcLineIndex indices as IfcPositiveInteger#2042
beachtom wants to merge 1 commit into
mainfrom
ISSUE_1881

Conversation

@beachtom

Copy link
Copy Markdown
Collaborator

In generateInitialiser and generatePropAssignment, list types whose element type is itself an IFC type (e.g. IfcPositiveInteger) were deserialised using raw x.value (a plain number) instead of wrapping each element in the correct typed constructor.

This caused IfcArcIndex and IfcLineIndex to expose Array instead of Array through the TypeScript API, breaking instanceof checks and the .type discriminator field.

Fix: detect when a list element type exists in the IFC types registry and emit new SchemaName.TypeName(x.value) instead of x.value.

Fixes #1881

In generateInitialiser and generatePropAssignment, list types whose
element type is itself an IFC type (e.g. IfcPositiveInteger) were
deserialised using raw x.value (a plain number) instead of wrapping
each element in the correct typed constructor.

This caused IfcArcIndex and IfcLineIndex to expose Array<number>
instead of Array<IfcPositiveInteger> through the TypeScript API,
breaking instanceof checks and the .type discriminator field.

Fix: detect when a list element type exists in the IFC types registry
and emit new SchemaName.TypeName(x.value) instead of x.value.

Fixes #1881

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[Bug]: Indices in IfcArcIndex/IfcLineIndex in IfcIndexedPolyCurve are numbers, not IfcPositiveInteger

2 participants