Skip to content

Js file type inference error #29553

Open
Open
@HSunboy

Description

TypeScript Version: 3.2.2

Code

person.js

let student = function () {
    this.age=12;
}
let person = {};
person.name=22;
student.prototype=person;
let tom = new student();

exports.tom =tom;

test.ts

import * as person from './person';
person.tom.name

Expected behavior: person.tom.name is not an error

Actual behavior:
image

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScriptcheckJsRelates to checking JavaScript using TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions