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

Overload Shows Everything #55260

Closed
iseeeva opened this issue Aug 3, 2023 · 2 comments
Closed

Overload Shows Everything #55260

iseeeva opened this issue Aug 3, 2023 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@iseeeva
Copy link

iseeeva commented Aug 3, 2023

πŸ”Ž Search Terms

When I use this function the autocomplete shows all values for the second parameters

πŸ•— Version & Regression Information

  • Typescript: 5.1.6

  • This might be a bug

⏯ Playground Link

https://www.typescriptlang.org/play?#code/C4TwDgpgBAcgrgWwEYQE4CUIEMAmAVcCAZygF4oByASwDtgAOCqAH0tuAEYA2J16ugMwAmXpQBmAGwD2WYMIoAoUJCgAhOGLFpMuApBLkKkmXJEtx02d1H9gEAOZpFEAB5gpqYFDFwaAY2AqKRooHRwAQSIACgA1LAk4CAAuKCJgVFp7ABooPWS1DS0MbHxCIhyAeTBA4KIAfhSAb1SAdywwAH0IGhwqLBoUpCkpCWwQgF8AShSaRBRUBVd3T29fAKCQsMjY+MSZubQcvJT4ZG0SvPKoKpqaeqbW9q6evoGoIZGxqCmUtIyaeyLNweLw+fy3UIlbZxBL5P6ZcyzM6oI6EE4HYq6MrmdSac5Y-SVaobe5QZpENqdbq9fqDYajfrfaapdII1hI+Zk8YKBRbaIABiyACJjFYuELJkA

πŸ’» Code

type NumberReadTypes = 'int8' | 'int16' | 'int32' | 'float32'
type BufferReadTypes = 'float32' | 'float16' | 'integer'
export function ReadAs(Value: string, Type: BufferReadTypes, Options?: { swap_endian: boolean }): number
export function ReadAs(Value: number, Type: NumberReadTypes, Options?: { swap_endian: boolean }): string
export function ReadAs(Value: string | number, Type: NumberReadTypes | BufferReadTypes, Options?: { swap_endian: boolean }): string | number {}

ReadAs(0,"float16")

πŸ™ Actual behavior

When I use this function the autocomplete shows all values for the second parameters.


image

πŸ™‚ Expected behavior

i just want see true overload

@jcalz
Copy link
Contributor

jcalz commented Aug 3, 2023

Duplicate #26892

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Aug 3, 2023
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants