Skip to content

Call signature is not recognized as 'extra' in object literals #14170

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
anvish opened this issue Feb 18, 2017 · 1 comment
Closed

Call signature is not recognized as 'extra' in object literals #14170

anvish opened this issue Feb 18, 2017 · 1 comment
Labels
Fixed A PR has been merged for this issue

Comments

@anvish
Copy link

anvish commented Feb 18, 2017

TypeScript Version: 2.1.6

Code

interface A {
    a?: string
}
const a1: A = { b: 2 } // correct: error "Object literal may only specify known properties"
const a2: A = () => { } // incorrect: no error

Expected behavior:
Call signature is treated like an excessive property, so both lines emit an error.
Actual behavior:
Only properties are checked, so only first line emits an error.

See #3755

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label May 24, 2017
@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Needs Investigation This issue needs a team member to investigate its status. labels Feb 8, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Feb 8, 2018

Should be working in latest.

@mhegazy mhegazy closed this as completed Feb 8, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants