Skip to content

Type main!'s arguments as OsStr in the platform header - #554

Merged
Anton-4 merged 2 commits into
mainfrom
main-takes-os-str
Nov 12, 2026
Merged

Anton-4 merged 2 commits into
mainfrom
main-takes-os-str

Conversation

@rtfeldman

@rtfeldman rtfeldman commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

The platform header spelled out main!'s argument type as the tag union behind OsStr, while main_for_host! passes a List(OsStr) and every example annotates main! with List(OsStr). That only type-checks because the compiler currently lets a written-out tag union stand in for a named type with the same tags, and a planned compiler change makes a written-out type mean exactly what it says. This names OsStr in the header instead, and writes main_for_host!'s annotation the same way.

Nothing changes for apps on current compilers: apps that annotate main! with List(OsStr), leave it unannotated, or call OsStr.from_raw on each argument all keep compiling. Once the compiler change lands, the arguments are simply OsStr values, so an app that called OsStr.from_raw on them passes them to OsStr functions directly.

@Anton-4
Anton-4 merged commit 05d577f into main Nov 12, 2026
42 checks passed
@Anton-4
Anton-4 deleted the main-takes-os-str branch November 12, 2026 11:17
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