Thanks to visit codestin.com
Credit goes to github.com

Skip to content

d2ir: fix multiple substitutions in imports - #1914

Merged
alixander merged 2 commits into
d2lang:masterfrom
alixander:variable-scope
Apr 17, 2024
Merged

d2ir: fix multiple substitutions in imports#1914
alixander merged 2 commits into
d2lang:masterfrom
alixander:variable-scope

Conversation

@alixander

Copy link
Copy Markdown
Collaborator

Turns out we can't cache the IR for imports.

The same file may be imported into different scopes, which change the substitutions of vars. But when a cache is used, the same var in the AST gets replaced.

We can probably replace these upon returning cached result, but I think it's fickle and IR compilations are fast anyway.

closes #1892

@alixander
alixander merged commit d1052f4 into d2lang:master Apr 17, 2024
@alixander
alixander deleted the variable-scope branch April 17, 2024 23:05
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.

Variable Scoping not honored on imports

1 participant