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

bug(semantic): Export equals declaration not counted as a Read reference #4488

Closed
DonIsaac opened this issue Jul 26, 2024 · 5 comments · Fixed by #4502
Closed

bug(semantic): Export equals declaration not counted as a Read reference #4488

DonIsaac opened this issue Jul 26, 2024 · 5 comments · Fixed by #4502
Labels
A-semantic Area - Semantic C-bug Category - Bug good first issue Experience Level - Good for newcomers

Comments

@DonIsaac
Copy link
Contributor

Found by #4445
Correct, counts as a Reference::Read

image

Incorrect, does not count as a Reference::Read

type Foo = number
export = Foo
image
@DonIsaac DonIsaac added C-bug Category - Bug A-semantic Area - Semantic good first issue Experience Level - Good for newcomers labels Jul 26, 2024
@Dunqing
Copy link
Member

Dunqing commented Jul 27, 2024

type Foo = number
export { Foo }

In this example. The foo flagged as ReferenceFlags::Read and ReferenceFlags::Type. Do you think we should just flag foo as ReferenceFlags::Type?

@Dunqing
Copy link
Member

Dunqing commented Jul 27, 2024

type Foo = number
export { Foo }

In this example. The foo flagged as ReferenceFlags::Read and ReferenceFlags::Type. Do you think we should just flag foo as ReferenceFlags::Type?

It would be better if we only flagged it as ReferenceFlags::Type, We can determine Foo is a type symbol by ReferebceFlags. That would be useful for fixing #4504

@DonIsaac
Copy link
Contributor Author

What if it's not a type? Shouldn't export = compile to module.exports =? Or is it only used in type declarations?

@Dunqing
Copy link
Member

Dunqing commented Jul 28, 2024

What if it's not a type? Shouldn't export = compile to module.exports =? Or is it only used in type declarations?

Both value and type declarations can be referenced.
image

@DonIsaac
Copy link
Contributor Author

Closing this as it seems resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-semantic Area - Semantic C-bug Category - Bug good first issue Experience Level - Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants