้•œๅƒ็ซ™็‚น ยท ๆœฌ้กต็”ฑ็ฌฌไธ‰ๆ–น GitHub ๅช่ฏป้•œๅƒๆไพ›๏ผŒ้ž GitHub ๅฎ˜ๆ–น็ซ™็‚น๏ผŒไธๆŽฅๅ—ไปปไฝ•็™ปๅฝ•ๆˆ–ๅ‡ญๆฎ่พ“ๅ…ฅใ€‚ๅ‰ๅพ€ github.com
Skip to content

Type printing does not detect that a name is shadowed in the current scopeย #58456

Open

Description

๐Ÿ”Ž Search Terms

global shadowed declarations

๐Ÿ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed

โฏ Playground Link

Playground Link

๐Ÿ’ป Code

// @strict: true
// @declaration: true
// @target: es2020

// @filename: a.ts
export const o = {[Symbol.iterator]: 1}

// @filename: b.ts

import { o } from "./a";
export class Symbol { }
export const g = o;

๐Ÿ™ Actual behavior

The typeof of g is { [Symbol.iterator]: number; }. This leads to an incorrect declaration since Symbol is shadowed in the current scope

๐Ÿ™‚ Expected behavior

The typeof of g is { [globalThis.Symbol.iterator]: number; }.

Additional information about the issue

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions