Skip to content

Abstract classes will still import the value for a computed property at runtime #33525

@puppy0cam

Description

@puppy0cam

TypeScript Version: 3.7.0-dev.20190920

abstract class import computed property
abstract class computed property imports for runtime

Code
sharedSymbol.ts

export const sharedSymbol: unique symbol = Symbol();

AbstractClass.ts

import { sharedSymbol } from "./sharedSymbol";

abstract class AbstractClass {
    public abstract [sharedSymbol]: string;
}

Expected behavior:
sharedSymbol.js is not imported by AbstractClass.js
Actual behavior:
The symbol is imported by AbstractClass.js despite it's use being omitted due to it's abstract nature

Playground Link: Unavailable due to the bug being related to imported values.

Related Issues: No, I did not find any

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JS EmitThe issue relates to the emission of JavaScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions