Skip to content

[Errors] with blocks #127

Closed
Closed
@mhegazy

Description

@mhegazy
with(x) { var y = 1; } 

Expected: (1,6): error TS2135: All symbols within a with block will be resolved to 'any'.

Actual: (1,6): Could not find symbol 'x'.

If x is defined prior to the with block then the new compiler issues no errors at all.

See also:

tests/cases/compiler/withStatement.ts

tests/cases/compiler/withStatementErrors.ts

tests/cases/compiler/withStatementNestedScope.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions