Repository navigation
Variant collision diagnostic + factor algebra_templates_for_profile into std/algebra.dag #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f17cdd9
Add VariantCollisionWarning diagnostic for imported enum variant name…
cursoragent 7f57f3e
Factor algebra_templates_for_profile into std/algebra.dag, add Boolea…
cursoragent 6d2716a
Fix full_dsl_compiles test: filter warnings from error count
cursoragent 0cecc3e
Promote all warnings to errors, remove warning infrastructure
cursoragent 0fa6382
Update docs: mark C-8 FIXED, check off completed Tier 1/2/2.5 items
cursoragent 336fe8c
Resolve 3 review violations: fail-closed collision, FF import index, …
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ module v2.compiler.compile | |
|
|
||
| import v2.std.core { | ||
| CompileResult, TextFile, SourceSpan, | ||
| ErrorNode, CompilerDiagnostic, is_error_diagnostic, diagnostic_to_message, diagnostic_to_span, make_error_node, InternalError, OwnershipWarning, no_span, | ||
| ErrorNode, CompilerDiagnostic, is_error_diagnostic, diagnostic_to_message, diagnostic_to_span, make_error_node, InternalError, OwnershipViolation, no_span, | ||
| Connective, NoConnective, Cardinality, | ||
| resource_use_name, resource_use_resource, | ||
| param_node_name, param_node_type_expr, param_node_default_value, param_node_span, | ||
|
|
@@ -119,7 +119,7 @@ fn ownership_diagnostics(proofs: List<OwnershipProof>) -> List<ErrorNode> { | |
| proof.decisions |> flat_map(decision => | ||
| match decision { | ||
| SharedError { binding: binding, consumer_count: count, sites: sites } => | ||
| [make_error_node(diagnostic: OwnershipWarning { binding: binding, fn_name: proof.func_name, consumers: count, span: no_span() }, module_name: proof.func_name)] | ||
| [make_error_node(diagnostic: OwnershipViolation { binding: binding, fn_name: proof.func_name, consumers: count, span: no_span() }, module_name: proof.func_name)] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Invariant violation: Stage 6 now emits |
||
| _ => [] | ||
| } | ||
| ) | ||
|
|
@@ -653,7 +653,7 @@ fn serialize_typed_module(module: TypedModule) -> String { | |
| } | ||
|
|
||
| fn serialize_diagnostic(diagnostic: ErrorNode) -> String { | ||
| let severity = if is_error_diagnostic(d: diagnostic.diagnostic) { "error" } else { "warning" } | ||
| let severity = "error" | ||
| concat( | ||
| "{\"severity\": ", json_quote(s: severity), | ||
| ", \"message\": ", json_quote(s: diagnostic_to_message(d: diagnostic.diagnostic)), | ||
|
|
@@ -842,6 +842,19 @@ fn compile_sources(sources: List<SourceFile>, target: RenderTarget) -> PipelineR | |
| let ownership = extract_ownership_proofs(typed: typed) | ||
| let ownership_diags = ownership_diagnostics(proofs: ownership) | ||
|
|
||
| // Gate: ownership errors block emission (Early Detection invariant). | ||
| let ownership_errors = ownership_diags |> filter(d => is_error_diagnostic(d: d.diagnostic)) | ||
| if ownership_errors |> count > 0 { | ||
| return PipelineResult { | ||
| files: [], | ||
| diagnostics: concat(frontend.diagnostics, norm_diags, all_infer_diags, ownership_diags), | ||
| complexity: complexity, | ||
| ownership: ownership, | ||
| artifact_plan: empty_artifact_plan(), | ||
| newline_indices: newline_indices | ||
| } | ||
| } | ||
|
|
||
| // Stage 7: Default artifact planning for the current single-artifact flow. | ||
| let artifact_plan = default_artifact_plan( | ||
| root_modules: typed.modules |> map(m => m.module.name), | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invariant violation: When two explicitly imported enums share a variant name, this code still overwrites locals with one enum after only emitting VariantCollisionWarning, fabricating a winner for an ambiguous reference and violating No fallbacks that fabricate / Explicit boundary contracts.