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

error TS2345: Argument of type 'string | MemberQueryFilter' is not assignable to parameter of type 'MemberQueryFilter' #622

Closed
huan opened this issue Jun 28, 2017 · 0 comments
Labels

Comments

@huan
Copy link
Member

huan commented Jun 28, 2017

According to microsoft/TypeScript#1805 (comment)
the following code is not valid in TypeScript:

function foo(x: number);
function foo(x: string);
function foo(x: number|string) {/***/}

var c: number|string;
foo(c); // ERROR: Argument type 'number|string' not assignable to parameter type 'string'

This is an very old issue. It's very strange that I just ran into this issue recently(this week). The same code work without any problem before(with tsc and tslint, in the past 12 months).

See https://circleci.com/gh/Chatie/wechaty/1884?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

src/room.ts(518,40): error TS2345: Argument of type 'string | MemberQueryFilter' is not assignable to parameter of type 'MemberQueryFilter'.
  Type 'string' has no properties in common with type 'MemberQueryFilter'.
@huan huan added the bug label Jun 28, 2017
huan added a commit that referenced this issue Jun 28, 2017
@huan huan closed this as completed Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant