-
Notifications
You must be signed in to change notification settings - Fork 625
refactor(semantic): Split SemanticGroup into traits per item. #8389
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
refactor(semantic): Split SemanticGroup into traits per item. #8389
Conversation
7e60308
to
f98277e
Compare
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.
@eytan-starkware reviewed 50 of 85 files at r1, 16 of 22 files at r2, all commit messages.
Reviewable status: 66 of 85 files reviewed, 8 unresolved discussions (waiting on @TomerStarkware)
crates/cairo-lang-semantic/src/items/enm.rs
line 404 at r2 (raw file):
// TODO(spapini): Consider making these queries. pub trait SemanticEnumEx: Database {
Can we combine SemanticEnumEx with EnumSemantic?
crates/cairo-lang-semantic/src/items/free_function.rs
line 99 at r2 (raw file):
} /// Query implementation of [SemanticGroup::free_function_declaration_implicit_precedence]
Update SemanticGroup referene
crates/cairo-lang-semantic/src/expr/inference/solver.rs
line 892 at r2 (raw file):
/// Trait for solver-related semantic queries. pub trait SemanticSolver<'db>: Database {
We can skip the trait for a single function and call the function directly, or merge this with another trait
crates/cairo-lang-semantic/src/items/implization.rs
line 41 at r2 (raw file):
/// Trait for implization-related semantic queries. pub trait ImplizationSemantic<'db>: Database { /// Returns the impl type for the given trait type, by implization by the given impl context, if
For a single function we can skip defining the trait
crates/cairo-lang-semantic/src/items/imp.rs
line 5116 at r2 (raw file):
false }
Comment on trait
crates/cairo-lang-semantic/src/items/imp.rs
line 5124 at r2 (raw file):
) -> Diagnostics<'db, SemanticDiagnostic<'db>> { impl_semantic_declaration_diagnostics_tracked(self.as_dyn_database(), impl_def_id) }
Either format with a line between functions, or no line between functions in the trait
crates/cairo-lang-semantic/src/items/generics.rs
line 845 at r2 (raw file):
} /// Trait for generics-related semantic queries.
GenericParam semantics, not Generics
crates/cairo-lang-semantic/src/items/functions.rs
line 1106 at r2 (raw file):
/// Trait for functions-related semantic queries. pub trait FunctionsSemantic<'db>: Database {
FunctionSignatureSemantics?
f98277e
to
cb8148c
Compare
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.
Reviewable status: 66 of 85 files reviewed, 8 unresolved discussions (waiting on @eytan-starkware and @TomerStarkware)
crates/cairo-lang-semantic/src/expr/inference/solver.rs
line 892 at r2 (raw file):
Previously, eytan-starkware wrote…
We can skip the trait for a single function and call the function directly, or merge this with another trait
we can - but i'd rather be consistent for now.
crates/cairo-lang-semantic/src/items/enm.rs
line 404 at r2 (raw file):
Previously, eytan-starkware wrote…
Can we combine SemanticEnumEx with EnumSemantic?
we can - but not as part of this PR.
crates/cairo-lang-semantic/src/items/free_function.rs
line 99 at r2 (raw file):
Previously, eytan-starkware wrote…
Update SemanticGroup referene
Done.
crates/cairo-lang-semantic/src/items/functions.rs
line 1106 at r2 (raw file):
Previously, eytan-starkware wrote…
FunctionSignatureSemantics?
maybe - but it isn't really just about the signature - so i'm ok with sticking to the file name.
crates/cairo-lang-semantic/src/items/generics.rs
line 845 at r2 (raw file):
Previously, eytan-starkware wrote…
GenericParam semantics, not Generics
Done.
crates/cairo-lang-semantic/src/items/imp.rs
line 5116 at r2 (raw file):
Previously, eytan-starkware wrote…
Comment on trait
Done.
crates/cairo-lang-semantic/src/items/imp.rs
line 5124 at r2 (raw file):
Previously, eytan-starkware wrote…
Either format with a line between functions, or no line between functions in the trait
Done.
crates/cairo-lang-semantic/src/items/implization.rs
line 41 at r2 (raw file):
Previously, eytan-starkware wrote…
For a single function we can skip defining the trait
it extends the methods of db - so i'd rather do it.
cb8148c
to
e3d6aba
Compare
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.
@eytan-starkware reviewed 13 of 85 files at r1, 2 of 22 files at r2, 14 of 14 files at r3, 2 of 3 files at r4, all commit messages.
Reviewable status: 84 of 85 files reviewed, all discussions resolved (waiting on @TomerStarkware)
crates/cairo-lang-semantic/src/items/generics.rs
line 845 at r2 (raw file):
Previously, orizi wrote…
Done.
Also for the trait name
Additionally making all things that can now not be `pub` not `pub`.
e3d6aba
to
569cd9c
Compare
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.
@eytan-starkware reviewed 1 of 3 files at r4, 8 of 8 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware)
Additionally making all things that can now not be
pub
notpub
.