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: Record used module #158

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

He1pa
Copy link
Contributor

@He1pa He1pa commented Aug 16, 2022

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

2. What is the scope of this PR (e.g. component or file name):

sema/resolver/var.rs

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

Fix bug in resolve_var(). When enter child scope, e.g., in a schema scope, cant find module object.
It should be recursively search whole scope to lookup module object, not the current scope.element.

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

6. Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@He1pa He1pa self-assigned this Aug 16, 2022
@He1pa He1pa added bug Something isn't working semantic Issues or PRs related to kcl semantic and checker debug Issues or PRs related to kcl debug enhancement fix resolver labels Aug 16, 2022
@He1pa He1pa added this to the v0.4.3 Release milestone Aug 16, 2022
Copy link
Contributor

@zong-zhe zong-zhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coveralls
Copy link
Collaborator

coveralls commented Aug 16, 2022

Pull Request Test Coverage Report for Build 2872278828

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 58.995%

Totals Coverage Status
Change from base Build 2872238247: -0.6%
Covered Lines: 21365
Relevant Lines: 36215

💛 - Coveralls

@zong-zhe zong-zhe self-requested a review August 17, 2022 01:42
zong-zhe
zong-zhe previously approved these changes Aug 17, 2022
Recursively seach whole scope to lookup module object and record it as `used`
@He1pa He1pa force-pushed the fix_record_used_module_when_resolve_var branch from 757b14b to 498882d Compare August 17, 2022 02:02
@He1pa He1pa requested a review from Peefy August 17, 2022 02:38
Copy link
Contributor

@Peefy Peefy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@He1pa He1pa requested a review from zong-zhe August 17, 2022 06:23
Copy link
Contributor

@zong-zhe zong-zhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@He1pa He1pa merged commit 051607a into kcl-lang:main Aug 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working debug Issues or PRs related to kcl debug enhancement fix resolver semantic Issues or PRs related to kcl semantic and checker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Record whether the module has been used in symbol table(Scope)
4 participants