Skip to content

const x = require("m") should create an alias symbol #25533

@ghost

Description

TypeScript Version: 3.0.0-dev.20180707

Code

/// <reference path='fourslash.ts'/>

// @allowJs: true

// @Filename: /a.js
////function [|{| "isWriteAccess": true, "isDefinition": true |}x|]() {};
////module.exports = [|x|];

// @Filename: /b.js
////const [|x|] = require("./a");
////[|x|];

const [r0, r1, r2, r3] = test.ranges();
verify.referenceGroups(r2, [/*todo*/]);

Expected behavior:

x in const x is an alias of the x in function x() {}, so all references are found.

Actual behavior:

x is a variable that happens to be the same type as the other x. Only references in b.js are found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyFix AvailableA PR has been opened for this issuecheckJsRelates to checking JavaScript using TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions