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

didn't have wran message when use bad syntax #37454

Closed
bluelovers opened this issue Mar 18, 2020 · 2 comments · Fixed by #41044
Closed

didn't have wran message when use bad syntax #37454

bluelovers opened this issue Mar 18, 2020 · 2 comments · Fixed by #41044
Labels
Bug A bug in TypeScript
Milestone

Comments

@bluelovers
Copy link
Contributor

bluelovers commented Mar 18, 2020

TypeScript Version: 3.7.x-dev.201xxxxx

Search Terms:

Code

export interface IA
{
	({
		a: string // <=== bad syntax
	}): any
}

Expected behavior:

show error message

Actual behavior:

nope

Playground Link:

Related Issues:

@j-oliveras
Copy link
Contributor

j-oliveras commented Mar 18, 2020

I see an error on string:

Binding element 'string' implicitly has an 'any' type.

Solving it to (playground):

export interface IA
{
	({ a }: { a: string}): any
}

let a: IA = () => {};

a({
	a: 0
})

or (playground)

export interface IA
{
	(obj: { a: string}): any
}

let a: IA = () => {};

a({
	a: 0
})

I see an error on a: 0:

Type 'number' is not assignable to type 'string'.(2322)
The expected type comes from property 'a' which is declared here on type '{ a: string; }'

@bluelovers
Copy link
Contributor Author

export interface IA
{
	({
		a: string // <=== bad syntax
	}): any
}

im not mean about noImplicitAny is enable or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants