Skip to content
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

fix(rivet/checker): fix alias declaration #39

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions lib/rivet/src/checker/decls.ri
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ extend Checker {
}
},
.Alias as alias_decl -> {
self.check_name_case(
if alias_decl.is_typealias or alias_decl.sym is ast.TypeSym
or (alias_decl.sym is ast.SymRef as sym_ref
and sym_ref.ref is ast.TypeSym) {
.Pascal
} else {
.Snake
alias_sym := if alias_decl.sym is ast.SymRef as sym_ref { sym_ref.ref } else { alias_decl.sym };
self.check_name_case(match {
alias_decl.is_typealias or alias_sym is ast.TypeSym -> .Pascal,
alias_sym is ast.Const -> .Upper,
else -> .Snake
}, "alias", alias_decl.name, alias_decl.pos
)
);
},
.Extern as extern_decl -> {
self.inside_extern = true;
Expand Down