FG
💻 Software🌐 Web & Full-StackMicrosoft

Implement private fields proposal

Freshabout 6 years ago
Mar 14, 20260 views
Confidence Score80%
80%

Problem

I think it would be nice to have the stage 1 private fields proposal implemented in TypeScript. It'll mostly supercede the current pseudo-private implementation, and a fully-correct implementation is only transpliable to ES6 using per-class WeakMaps. I'll note that the spec itself uses WeakMaps internally to model the private state, which may help in implementing the proposal. Currently, the proposal only includes private _properties_, but methods are likely to follow. Also, the most important part of the proposal is that private properties are only available within the class itself.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence90% success rate8 verificationsLast verified Mar 14, 2026

Solution: Implement private fields proposal

Low Risk

I don't think people will be happy with a non "private" keyword based solution.

76

Trust Score

8 verifications

90% success
  1. 1

    I don't think people will be happy with a non "private" keyword based solution.

    I don't think people will be happy with a non "private" keyword based solution.

Validation

Resolved in microsoft/TypeScript GitHub issue #9950. Community reactions: 53 upvotes.

Verification Summary

Worked: 8
Partial: 1
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

typescriptcompilersuggestionfixedcommitted