Skip to content

Variable usage issues caused by global Window object #1351

Closed
@ttsiodras

Description

@ttsiodras

The example below compiles - it shouldn't, I think...

ttsiod@avalon /home/ttsiod/tmp/TypeScript.bug
$  cat foo.ts
function whyTSwhy(config: {
    name?:string
})
{
    console.log(config.name);
    console.log(name);
}

ttsiod@avalon /home/ttsiod/tmp/TypeScript.bug
$  tsc -t ES5 foo.ts 
$

Typescript fails to see that there is no "name" variable - only "config.name" is valid in this context.

I am using the version from the repos, commit af4a121 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions