Draft
Conversation
Co-authored-by: Claude <noreply@anthropic.com>
The lexer greedily tokenises `>>`, `>=`, and `>>=` as single tokens, which breaks nested generic type annotations like `List<List<Int>>`. The parser now splits these compound tokens when closing angle brackets in type parameter lists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduces TypeBinding enum (Inferred/Annotated) to track whether a variable was declared with an explicit type annotation. Annotated bindings refuse type widening on reassignment, emitting a type mismatch error instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extends the annotated binding check to OpAssignment (+=, /=, etc.). Also fixes a bug where destructured `let v, n = 100, 100` incorrectly marked sub-bindings as annotated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds `named_parameter` parser for function param lists, separate from `named_binding` (used by `let` destructuring). Params now accept optional type annotations (e.g. `fn foo(x: Int)`). Also adds `TypeSignature::from_annotated_bindings` constructor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Parse `-> Type` return type annotations on function declarations - Analyser validates inferred return type against annotation - Parameter type annotations now feed into analysis (no longer ignored) - Register Int-specific overloads for +, -, *, % with fast i64 path - Register Float-specific overloads for +, -, *, /, % - Widen container element type on index op-assignment (e.g. x[0] /= 3) - Add StaticType::with_element_type helper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…holders 🔄 When pre-registering a recursive function, use the declared return type annotation instead of Any so that recursive calls resolve correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce FunctionParameter to unify parameter representation in the AST, replacing TypeSignature on FunctionDeclaration. Move inferred return types to an AnalysisResult side table so the LSP can distinguish annotated vs inferred return types. Walk parameter lvalues in the visitor so parameter type hints are emitted. Also compute the LUB of return types across all overload candidates in dynamic bindings, improving type inference for overloaded functions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.