Skip to content

Assigning namespaced classes to a variable results in an assertion error #1790

Closed
@saulecabrera

Description

@saulecabrera

Taking into account the following code:

// bar.ts

export namespace bar {
  export class Bar{}
}
import { bar } from './bar';

export const aliasBar = bar.Bar;

This results in an assertion rather than a diagnostic, I'm aware that the expression above is not legal, and as such, I think this should emit the same diagnostic as if the imported class didn't belong to a namespace:

ERROR AS234: Expression refers to a static element that does not compile to a value at runtime.

Compiler version: 0.18.21

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions