Old pony 5279#173
Merged
Merged
Conversation
…tters (#5309) HoverFormatter, SignatureHelp, and _TypeFormatter all accepted a Channel argument that was threaded through every internal function but never used. Remove it from all signatures and update the two call sites in workspace_manager.pony.
Two bugs: - ponylang/ponyc#1216 -- `interface Iter[A] fun enum[B](): Iter[(B, A)] => this` hangs the compiler indefinitely. - ponylang/ponyc#3930 -- `fun flatten[A: Array[Array[A]] #read](...)` crashes the compiler with a stack overflow. `exact_nominal` in src/libponyc/type/subtype.c compared typeargs via `is_eq_typeargs`, which calls `is_eqtype` -> `is_subtype` -> back into `check_assume` on the same recursive shapes. The re-entry stack- overflowed on #3930 and produced residual exponential fan-out that made the SAME_DEF_LIMIT divergence guard unreachable in practice for The fix replaces `is_eq_typeargs` in `exact_nominal` with a structural AST equality function (`exact_type`) that compares definition pointers (`ast_data`) for nominals, type parameter references, and type alias references, and walks children for compound forms. It does not call back into the subtype machinery, so the recursion characteristics are preserved while correctly distinguishing typeparams that share a source name across scopes. A new SAME_DEF_LIMIT divergence guard in `is_nominal_sub_nominal` bounds the depth of any single drifting recursion chain. K = 4 was chosen empirically -- K = 2 was refuted by pony_check shapes that need more drifting rounds to converge. Bidirectional coupling comments on subtype.c and packages/pony_check/generator.pony record the validation procedure. The conceptual fix -- avoiding re-entry from `exact_nominal` into the subtype machinery -- was originally authored by Red Davies on branch `origin/issue_3930`. An earlier iteration of this PR used `ast_print_type` string comparison; jemc's review identified that as unsound (the printer collapses typeparams sharing a source name across scopes), and the structural AST equality version replaced it. Also adds project-level regression guard tests for three related shapes (#5198, #2399, #2562) that already terminate cleanly on main without this PR's changes -- kept as guards against the shapes being broken again by future work. Those issues are closed separately as already-fixed. Closes #1216 Closes #3930
…lsp hover (#5311)
…312)
Remove keyword: String parameter from extract_method_info in pony-lsp
extract_method_info was dispatching on string comparison ("fun", "be",
"new") to decide whether to extract a return type. Since ast is already
a parameter, derive the token ID from ast.id() inside the function and
compare against TokenIds constants instead.
An unrecognised token ID now returns None rather than silently producing
a malformed MethodInfo.
…ors in pony-lsp (#5313) Following the same pattern as extract_method_info, remove the keyword: String parameter from extract_entity_info, _extract_field_info, and _extract_local_var_info. Each function now derives its keyword from ast.id() via a match expression internally. An unrecognised token ID returns None rather than silently producing a malformed info object.
Behaviour return types are always `None val` inserted by the sugar pass and are not writable by the user (adding `: None` to a `be` definition is a compile error). Displaying them in hover creates noise without conveying useful information.
Replaces US spellings (serialize, initialize/initialization, behavior/behaviors) with British equivalents in prose that is not constrained by the LSP protocol.
Class fields can carry docstrings per the Pony grammar. Hovering over a field now includes the docstring below the declaration, consistent with how entity and method hover already behave.
Three Windows-only `try` blocks on the IOCP write/completion path swallowed errors silently because they had no `else` arm. When an IOCP write failed or completion bookkeeping went inconsistent, the connection didn't close; queued bytes piled up on a dead socket. The POSIX sibling already handled the same condition with `else hard_close()` and a "Non-graceful shutdown on error." comment — the Windows path was the missing-`else` outlier. Adds the same `else hard_close()` arm to all three sites (`writev`, `write_final`, `_complete_writes`). The third site also needs an explicit `return` to skip the post-try `_release_backpressure()` call — without it, `unthrottled` would fire on the user's notify after `closed`, matching neither POSIX behavior nor the function's own `len == 0` early-return pattern. Updates docstrings on `writev` and `_complete_writes` to mention the on-error close behavior. `write_final`'s docstring already promised it. Closes #5287
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.