Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bug: Cannot read property 'flags' of undefined #2127

Copy link
Copy link
@osi-oswald

Description

@osi-oswald
Issue body actions

Trying to compile

interface IBar {
    [barId: string]: any;
}

interface IFoo {
    foo<TBar extends IBar>(bar: TBar, bar1: (bar: TBar)=>any, bar2: (bar: TBar)=>any);
}

var foo: IFoo;
foo.foo({bar: null}, bar => null, bar => null);

leads to the following error

if (source.flags & 128 /* Enum */ && target === numberType
          ^
TypeError: Cannot read property 'flags' of undefined
    at isRelatedTo (tsc.js:13077:31)
    at checkTypeRelatedTo (tsc.js:13048:26)
    at checkTypeSubtypeOf (tsc.js:13029:20)
    at reportNoCommonSupertypeError (tsc.js:13618:13)
    at resolveCall (tsc.js:14945:21)
    at resolveCallExpression (tsc.js:15075:20)
    at getResolvedSignature (tsc.js:15125:47)
    at checkCallExpression (tsc.js:15140:29)
    at checkExpressionWorker (tsc.js:15648:28)
    at checkExpressionOrQualifiedName (tsc.js:15605:42)

tsc version 1.4.1.0

You can also put this code into the typescript Playground, which does not complie it as well.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.