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(compiler): Redeclare imports [LNG-344] #1109

Merged
merged 12 commits into from
Apr 2, 2024
Merged

Conversation

DieMyst
Copy link
Member

@DieMyst DieMyst commented Apr 1, 2024

Description

Allow to redeclare imports to make aqua files that have only imports/declarations/exports

Checklist

  • Corresponding issue has been created and linked in PR title.
  • Proposed changes are covered by tests.
  • Documentation has been updated to reflect the changes (if applicable).
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

Copy link

linear bot commented Apr 1, 2024

@DieMyst DieMyst added the e2e Run e2e workflow label Apr 1, 2024
@InversionSpaces InversionSpaces self-requested a review April 1, 2024 10:14
else
else {
// summarize contexts to allow redeclaration of imports
val sumCtx = ctx |+| initCtx
Copy link
Contributor

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)
Copy link
Contributor

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

@DieMyst DieMyst enabled auto-merge (squash) April 2, 2024 08:46
@DieMyst DieMyst merged commit 8f06ac1 into main Apr 2, 2024
9 checks passed
@DieMyst DieMyst deleted the LNG-344-redeclare-improts branch April 2, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants