Skip to content

Deduplicate interface_list while preserving order - #1072

Closed
Sushil-Rahatole wants to merge 1 commit into
teal-language:mainfrom
Sushil-Rahatole:interface_list_duplicate_remove
Closed

Sushil-Rahatole wants to merge 1 commit into
teal-language:mainfrom
Sushil-Rahatole:interface_list_duplicate_remove

Conversation

@Sushil-Rahatole

Copy link
Copy Markdown
Contributor

This PR avoids duplicate entries in interface_list when collecting interfaces through multiple inheritance paths.

The change preserves the original interface order and does not alter conflict resolution semantics. Only the first occurrence of each interface is retained.

Note: I was not able to run the compiler locally; the change is a minimal refactor that preserves existing behavior.

Fixes #1018.

@github-actions

Copy link
Copy Markdown

Teal Playground URL: https://1072--teal-playground-preview.netlify.app

@hishamhm

Copy link
Copy Markdown
Member

Note: I was not able to run the compiler locally

You should be able to run it on a Linux environment like so:

  • install Lua and LuaRocks*
  • check out this repo and run luarocks make --deps-only to install dependencies
  • run make

(* You may also need to install other dependencies for a full development environment, on a Ubuntu environment you can ap install build-essential, for example)

Let us know if these instructions are sufficient or if you need more help!

Comment thread teal/check/context.tl
Comment on lines +1493 to +1498
local function collect_interfaces(
self: Context,
list: {ArrayType | NominalType},
t: RecordLikeType,
seen: {Type: boolean}
): {ArrayType | NominalType}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please do not change the style of these longer lines. (Same with self.errs:add below.) Thank you!

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.

ok

@hishamhm

hishamhm commented Feb 1, 2026

Copy link
Copy Markdown
Member

Merged manually via 47d784d (which seemed to build upon this PR) — thank you!

@hishamhm hishamhm closed this Feb 1, 2026
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.

internals: remove duplicate entries from interface_list

2 participants