Skip to content

Import statements should be hoisted #525

Description

@ark120202

Input:

const { bar } = foo;
import { foo } from 'foo';

Current Result:

local foo;
bar = foo.bar;
local __TSTL_foo = require("foo");
foo = __TSTL_foo.foo;

Expected Result:

local __TSTL_foo = require("foo");
local foo = __TSTL_foo.foo;
bar = foo.bar;

Note that TypeScript doesn't handle it correctly as well yet (microsoft/TypeScript#16166).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions