Skip to content

fix nary type inference for scopes - #1423

Merged
ssalbdivad merged 2 commits into
arktypeio:mainfrom
simonwkla:fix/1422-nary-scope
Apr 15, 2025
Merged

ssalbdivad merged 2 commits into
arktypeio:mainfrom
simonwkla:fix/1422-nary-scope

Conversation

@simonwkla

@simonwkla simonwkla commented Apr 15, 2025 •

Copy link
Copy Markdown
Contributor

fixes: #1422

  • Added scope $ to all nary type inference.
  • added n-ary (1-16) with scope tests and added normal n-ary test variants (1-16) where possible

@github-project-automation github-project-automation Bot moved this to To do in arktypeio Apr 15, 2025
@ssalbdivad ssalbdivad moved this from To do to In progress in arktypeio Apr 15, 2025
@simonwkla
simonwkla force-pushed the fix/1422-nary-scope branch 4 times, most recently from 8a7fbef to 8986148 Compare April 15, 2025 19:42
@simonwkla
simonwkla force-pushed the fix/1422-nary-scope branch from 8986148 to 58fcfa2 Compare April 15, 2025 20:02
@simonwkla
simonwkla marked this pull request as ready for review April 15, 2025 20:18
@simonwkla simonwkla changed the title #1422: fix nary type inference for scopes fix nary type inference for scopes Apr 15, 2025

@ssalbdivad ssalbdivad left a comment

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.

This is perfect! I just have a couple recommendations for simplifying:

  • You can just test the scoped cases as it's a superset of the unscoped cases (i.e. you can remove 3-ary and just keep 3-ary with scope and probably remove the with-scope suffix)

  • Instead of defining the scope in each test, you can use a contextualize.each block like this to set up a scope once you use for all the tests. This would be equivalent to just defining the scope at the module-level but in case something fails during the scope parsing, it doesn't cause all your tests not to run at all.

@simonwkla
simonwkla requested a review from ssalbdivad April 15, 2025 21:09
@ssalbdivad
ssalbdivad merged commit 3ed97b7 into arktypeio:main Apr 15, 2025
@github-project-automation github-project-automation Bot moved this from In progress to Done (merged or closed) in arktypeio Apr 15, 2025
@simonwkla
simonwkla deleted the fix/1422-nary-scope branch April 15, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done (merged or closed)

Development

Successfully merging this pull request may close these issues.

type inference resolves custom types from scopes to be "never" when using them in a union type

2 participants