Skip to content

Uncalled function checks only works with single conditional #35584

@mjbvz

Description

@mjbvz

TypeScript Version: 3.8.0-dev.20191207

Search Terms:

Code
With strict null checks enabled:

import * as fs from 'fs';

fs.stat('/path/to/file', function(err, stats) {
    if (stats.isFile || stats.isDirectory) {

    }
});

Expected behavior:
Accesses to isFile and isDirectory are reported as errors since these are actually functions

Actual behavior:
No errors.

Errors are only reported when there is a single conditional

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Experimentation NeededSomeone needs to try this out to see what happensGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do thisPursuitFellowshipHelp wanted from Pursuit fellowship; others please avoid until Dec 19SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions