feat(slang): complete modules and free functions - #654
Open
hedgar2017 wants to merge 1 commit into
Open
Conversation
hedgar2017
force-pushed
the
az-slang-modules
branch
4 times, most recently
from
August 16, 2026 17:16
f327bf5 to
3e06782
Compare
hedgar2017
requested review from
a team,
abinavpp and
ggiraldez
and
a balanced review from Copilot
and removed request for
Copilot and
ggiraldez
August 16, 2026 17:27
There was a problem hiding this comment.
Pull request overview
Extends Slang lowering for module-qualified members and reachable free functions.
Changes:
- Evaluates namespace qualifiers for side effects while resolving members by name.
- Supports module-qualified calls, aliases, libraries, and user-defined value types.
- Adds MLIR fixtures for module access and free-function emission paths.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
solx-slang/src/contract/function/expression/mod.rs |
Handles module-typed expression effects. |
solx-slang/src/contract/function/expression/member.rs |
Resolves namespace members after qualifier effects. |
solx-slang/src/contract/function/expression/call/mod.rs |
Classifies and evaluates namespace-qualified callees. |
solx-mlir/tests/lit/module_values.sol |
Tests effectful module-qualified expressions and calls. |
solx-mlir/tests/lit/module_members.sol |
Tests chained, renamed, and star imports. |
solx-mlir/tests/lit/free_function_using_for.sol |
Tests using-for free functions. |
solx-mlir/tests/lit/free_function_shadowing.sol |
Tests free-function shadowing. |
solx-mlir/tests/lit/free_function_pointer.sol |
Tests free-function pointers. |
solx-mlir/tests/lit/free_function_operator_reached.sol |
Tests operator-reachable free functions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hedgar2017
force-pushed
the
az-slang-modules
branch
3 times, most recently
from
August 16, 2026 20:28
7d0acd3 to
06af1a7
Compare
hedgar2017
force-pushed
the
az-slang-modules
branch
from
August 16, 2026 20:58
06af1a7 to
caa1472
Compare
Comment on lines
+315
to
323
| if let Some(Type::UserMetaType(meta)) = access.operand().get_type() | ||
| && let Definition::Contract(_) | Definition::Import(_) = meta.definition() | ||
| && let Some(Type::Function(function_type)) = access.get_type() | ||
| { | ||
| return Self::FunctionPointer( | ||
| Expression::MemberAccessExpression(access), | ||
| function_type, | ||
| ); | ||
| } |
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.
Completes module member access: a parenthesized or conditional form over import aliases is never materialized. It is evaluated for effect, and its members resolve by name. Alias chains, renames, star imports, and free functions in pointer, operator, and using-for positions are pinned by fixtures.
cargo run-tester-slang: 10323 → 10375 passed.