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

[Errors] Message quality degradation for overload resolution errors #93

Closed
mhegazy opened this issue Jul 17, 2014 · 1 comment · Fixed by #242
Closed

[Errors] Message quality degradation for overload resolution errors #93

mhegazy opened this issue Jul 17, 2014 · 1 comment · Fixed by #242
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Jul 17, 2014

// @module: commonjs

// @Filename: foo_0.ts

class Foo<T extends {a: string; b:number;}>{

test: T;

constructor(x: T){}

}

export = Foo;

// @Filename: foo_1.ts

import foo = require("./foo_0");

var x = new foo(true); // Should error

var y = new foo({a: "test", b: 42}); // Should be OK

var z: number = y.test.b;

Expected:

!!! Supplied parameters do not match any signature of call target:

!!! Type 'Boolean' is missing property 'a' from type '{ a: string; b: number; }'.

Actual:

‌!!! Supplied parameters do not match any signature of call target.

@mhegazy mhegazy added this to the TypeScript 1.2 milestone Jul 17, 2014
@DanielRosenwasser DanielRosenwasser changed the title [Errors] Message quality degradation for oveload resolution errors [Errors] Message quality degradation for overload resolution errors Jul 22, 2014
@DanielRosenwasser
Copy link
Member

Sufficiently stripped down:

function foo(x: { a: string }): number {
    return undefined;
}

foo(true);

Reports:

Supplied parameters do not match any signature of call target.

ahejlsberg added a commit that referenced this issue Jul 25, 2014
Fixes #93.
This is an evolution of #220.
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
3 participants