microsoft / microsoft/TypeScript

this type checking with conditional types

Open
#44,550 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

In Discussion Suggestion
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

Bug Report

🕗 Version & Regression Information

ts 4.3.2

⏯ Playground Link
  1. reproduce bug

  2. work fine without condition type, disabled type filtration

``

🙁 Actual behavior

Compilation error
Argument of type 'string' is not assignable to parameter of type 'PropertiesByType<this, string>'.(2345)

🙂 Expected behavior

Have no errors.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two TypeScript Playground links using TypeScript 4.3.2 and compare the conditional-type version with the version where type filtration is disabled. Investigate why the conditional type rejects the string argument, and consider the issue done when the reported reproduction compiles without errors while preserving the intended type checking.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.