Skip to content

Object spreading of primitive values is denied although it's valid JavaScript code #39292

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

Closed
falsandtru opened this issue Jun 27, 2020 · 1 comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@falsandtru
Copy link
Contributor

TypeScript Version: 3.7.x-dev.20200625

Search Terms:

Code

({ ...'' });

Expected behavior:
pass
Actual behavior:
Spread types may only be created from object types.(2698)
Playground Link:

Related Issues:

@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label Jun 27, 2020
@RyanCavanaugh
Copy link
Member

This is the intended behavior since intentionally spreading a string is extremely rare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

2 participants