Skip to content

feat(desugar): type aliases and extern types follow the rule of data types; the signing rule in CLAUDE.md - #436

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/e2e-language-pass-ow72tj
Nov 10, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/e2e-language-pass-ow72tj

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

2 commits, each from an owner decision of 2026-11-10.

  1. A type alias and an extern type follow the visibility rule of data types.
  2. The commit signing rule in CLAUDE.md says what is in the repository.

1. Visibility of type aliases and extern types

Each module used to see each alias and each extern type of the program, with no import. A data type already followed the rule of functions (#431). Now the 3 kinds of named type have one rule:

  • A module names a type when it declares it, or when it imports the module that declares it.
  • A data type and an alias must also be pub. An extern type is public, as an extern function is.
  • An import list must name the type: import lib(Meters, double).
  • An import does not pass on the types of the modules that the imported module imports.
Program (module app) Before Now
import lib and fn keep(m: Meters): Meters, with pub type Meters = I32 in lib accepted accepted
import lib and fn keep(f: Feet): Feet, with type Feet = I32 (private) in lib accepted refused: unknown type Feet
import lib(double) and a use of Meters accepted refused: unknown type Meters
import mid (where mid imports host) and a use of the extern type Handle of host accepted refused: unknown type Handle

A public function with a private alias in its signature stays usable: the importer does not name the alias.

How

The desugarer had 3 tables: data types in the scope of each module, and aliases and extern types for the whole program. A data type, an alias and an extern type are now in the one type table of the scope of a module (TypeInfo { def, home, public }, with TypeDef::{Data, Alias, Extern}). Thus a declaration of a name shadows an imported type of each kind. The import step drops alias names and extern type names from the core import list, as it does for data types, because the type checker reads each name in that list as a function.

No program of the corpus changed.

2. The commit signing rule

CLAUDE.md said that each commit has a signature of the owner key. In fact each commit on main is a squash merge that GitHub signs with its own key. The new text says:

  • GitHub signs each squash merge on main.
  • The owner key signs the commits that the owner makes on a local computer.
  • A cloud agent session signs its branch commits with its session key. No private key of the owner goes into such a session.

Verification

  • cargo test --workspace: 624 passed, 0 failed.
  • cargo fmt --all --check and cargo clippy --workspace --all-targets: clean.
  • scripts/status-gate.sh: 621 all-target tests (1 more than before).
  • scripts/probe-battery.sh: 51 SAME, 7 SKIP (the SKIP rows need the wasmtime CLI).
  • New test: a_module_names_an_alias_or_an_extern_type_only_through_an_import (4 programs run as wasm and in the interpreter, 2 programs compile, 4 programs are refused by name).

Generated by Claude Code

…a types

Owner decision 2026-11-10: a module names a `type` alias or an extern
type when it declares it, or when it imports the module that declares
it. An alias must also be `pub`. An extern type is public, as an extern
function is. An import list must name the type. Each module used to see
each alias and each extern type of the program, with no import.

A data type, an alias and an extern type are now in the one type table
of the scope of a module, so a declaration of a name shadows an imported
type of each kind. A type that a module cannot name is refused by name:
"unknown type `Feet`".

No program of the corpus changed. New test:
a_module_names_an_alias_or_an_extern_type_only_through_an_import.
624 tests pass; the all-target count is 621.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZmKrYLDC4WHi2yt11u
Owner ruling 2026-11-10. The rule said that each commit has a signature
of the owner key. Each commit on main is a squash merge that GitHub
signs with its own key. The owner key signs the commits that the owner
makes on a local computer. A cloud session signs with its session key,
and no private key of the owner goes into such a session.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZmKrYLDC4WHi2yt11u
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 10, 2026 18:46
@hyperpolymath
hyperpolymath merged commit ea310fa into main Nov 10, 2026
47 of 48 checks passed
@hyperpolymath
hyperpolymath deleted the claude/e2e-language-pass-ow72tj branch November 10, 2026 18:46
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T18:50:35.995727Z 58632c3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58632c325c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +278 to +280
let TypeDef::Data { ctors, .. } = &info.def else {
imported.types.insert(name.clone(), info.clone());
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve value imports that share a type name

When a module exports a function and a newly scoped alias or extern type with the same identifier, a selective import of that identifier now records it as a type here, and desugar_module consequently removes the identifier from the core import list. For example, extern "c" { type Handle; fn Handle(n: I32): I32 } followed by import host(Handle) makes the type available but leaves calls to Handle unbound, even though the grammar permits both declarations and the import names that identifier. Track type and value membership separately so importing a type does not suppress a same-named function.

Useful? React with 👍 / 👎.

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.

3 participants