-
Notifications
You must be signed in to change notification settings - Fork 24
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(compiler): Redeclare imports [LNG-344] #1109
Conversation
else | ||
else { | ||
// summarize contexts to allow redeclaration of imports | ||
val sumCtx = ctx |+| initCtx |
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.
I guess it is more reasonable to do initCtx |+| ctx
? Operation is not commutative and logically initCtx
goes before ctx
. WDYT?
@@ -30,16 +31,18 @@ class ModuleSem[S[_]: Comonad, C: Picker](expr: ModuleExpr[S])(using | |||
name.value, | |||
shouldDeclare | |||
), | |||
(ctx, _) => | |||
(ctx, initCtx) => | |||
// When file is handled, check that all the declarations exists | |||
if (declareAll.nonEmpty) |
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.
What about declares all case? Is not the same logic needed here?
aqua Lib declares *
import f from "..."
import g from "..."
seems like a valid use case
Description
Allow to redeclare imports to make aqua files that have only imports/declarations/exports
Checklist
Reviewer Checklist