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: missing functions in Source Native variants #1431

Merged
merged 3 commits into from
Jul 12, 2023

Conversation

shenyih0ng
Copy link
Member

@shenyih0ng shenyih0ng commented Jun 26, 2023

Fixes #1429

Description

Currently, when a user references certain functions in Source Native variants a <identifier> not undeclared error will be raised. These functions are mostly from the list and stream libraries.

The error occurs due to a bug in the runtime context of Source Native variants where functions from libraries are not properly keep tracked of. More specifically, the context only kept track of builtin functions and not those that injected via library preludes. This results in a failed check for undefined variables during the transpilation stage which raised the <identifier> not undeclared error back to the frontend.

The fix

  • Keep track of prelude identifier during first run of a Source Native context
  • Add previously declared identifier to the context after each run

@shenyih0ng shenyih0ng self-assigned this Jun 26, 2023
@coveralls
Copy link

coveralls commented Jun 26, 2023

Pull Request Test Coverage Report for Build 5430377185

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 83.504%

Totals Coverage Status
Change from base Build 5387187177: 0.03%
Covered Lines: 10624
Relevant Lines: 12313

💛 - Coveralls

@shenyih0ng shenyih0ng force-pushed the fix/missing-funcs-in-native branch from 9460fc5 to 8e940cd Compare July 1, 2023 09:08
@shenyih0ng shenyih0ng force-pushed the fix/missing-funcs-in-native branch from 8e940cd to 2b01807 Compare July 1, 2023 09:44
@shenyih0ng shenyih0ng marked this pull request as ready for review July 1, 2023 09:56
Copy link
Member

@martin-henz martin-henz left a comment

Choose a reason for hiding this comment

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

Looks good!

@martin-henz martin-henz merged commit d826f84 into master Jul 12, 2023
1 check passed
@martin-henz martin-henz deleted the fix/missing-funcs-in-native branch July 12, 2023 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source X Native: Some functions are not available
3 participants