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

Throw an error for a member reference that refers to different members over time #99

Open
nex3 opened this issue Oct 1, 2019 · 2 comments · May be fixed by #258
Open

Throw an error for a member reference that refers to different members over time #99

nex3 opened this issue Oct 1, 2019 · 2 comments · May be fixed by #258
Labels
bug Something isn't working module system Part of the module system migrator

Comments

@nex3
Copy link
Contributor

nex3 commented Oct 1, 2019

With @import, it's possible for a file to refer to a mixin or function that gets redefined later on. Right now References will just override the previous definition and treat it as though it always referred to whatever the last value was, but the more correct behavior would be to throw an error, since changing the definition isn't supported in the module system.

For example:

<==> input/entrypoint.scss
@import "definition1";
@import "upstream";
@import "midstream";

<==> input/definition1.scss
@function fn() {@return 1}

<==> input/definition2.scss
@function fn() {@return 2}

<==> input/midstream.scss
@import "definition2";
@import "upstream";

<==> input/upstream.scss
a {b: fn()}

I don't think this is worth fixing before we launch, though.

@nex3 nex3 added bug Something isn't working module system Part of the module system migrator labels Oct 1, 2019
nex3 added a commit that referenced this issue Oct 1, 2019
This error was already thrown when different results were generated
due to different entrypoints, but not for the same entrypoint. In
practice I don't think this can come up with the module migrator,
though, due to #99.
@nex3
Copy link
Contributor Author

nex3 commented Apr 11, 2023

Given that we're getting ready to start properly deprecating @import and this doesn't seem to be causing much user pain, I'm going to close it out as not planned.

@nex3 nex3 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
@nex3
Copy link
Contributor Author

nex3 commented Apr 11, 2023

Oops, thought this was an issue on the implementation. For the migrator, we probably should handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module system Part of the module system migrator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant