GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cannot access indexed type of constrained type parameter · Issue #12340 · microsoft/TypeScript

Cannot access indexed type of constrained type parameter #12340

New issue
Copy link
New issue
Copy link
Closed
Closed
Cannot access indexed type of constrained type parameter#12340
Copy link
Labels
DuplicateAn existing issue was already createdAn existing issue was already created

Description

@HerringtonDarkholme
Herrington Darkholme (HerringtonDarkholme)
opened on Nov 18, 2016
Issue body actions

Related: #12311

TypeScript Version: nightly
Code

type Boxed = {
    [k in string]: {value: any}
}

type Unboxed<T extends Boxed> = {
    [K in keyof T]: T[K]['value']
}

Expected behavior:
Should compile since Boxed has index signature. T with constraint Boxed should also be indexable, with T[K] constrained by Boxed's value type, in this case, {value: any}

Actual behavior:

Error, Property 'value' does not exist on type 'T[K]'

Activity

  1. ahejlsberg commented on Nov 18, 2016

    @ahejlsberg
    Anders Hejlsberg (ahejlsberg)
    on Nov 18, 2016
    Member
    More actions

    Duplicate of #12311. Fixed by #12351.

  2. Anders Hejlsberg (ahejlsberg)
    added
    DuplicateAn existing issue was already createdAn existing issue was already created
    on Nov 18, 2016
  3. Mohamed Hegazy (mhegazy)
    closed this as completedon Nov 18, 2016
  4. microsoft
    locked and limited conversation to collaborators on Jun 19, 2018
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

    DuplicateAn existing issue was already createdAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.