Repository navigation
Conversation
…it inherits, so another module's local never shadows a program's top-level binding A script's top-level binding is injected into its helpers (D184) and marked in script_capture_indices, which lets a helper's own local take the name. When a helper's call triggered a generic instance check, enter_callee_lexical_env copied the helper's module-scope bindings (the injected ones among them) into the callee's environment and reset the marks, so std's `let i` in enumerate's `next` was refused as shadowing a program's `var i`: any program with a top-level `var i` and a call of enumerate() failed, the error pointing into the standard library (the pinned seed too). The marks now travel with the copied bindings. Fixtures: behav_3187_script_global_beside_enumerate (std) and behav_3187_script_global_beside_module_generic (a user module's generic method, lib/pair_3187.w).
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3187. A program with a top-level
var i(a script global) and a call ofenumerate()was refused with 'shadowing is not allowed' pointing into std:enter_callee_lexical_envcopied the helper's injected script bindings into the generic instance's environment without their D184 marks. The marks now travel with the bindings. Fixtures: behav_3187_script_global_beside_enumerate, behav_3187_script_global_beside_module_generic (+ lib/pair_3187.w). Dev stage1: both fixtures and all 26 shadowing/D184 fixtures green. Gate and battery to follow.