You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parameter property syntax saves quite a bit of boilerplate for class initialization, especially for large classes (which tends to be the case in the DevTools codebase). We are currently considering adopting private class fields in our codebase (for runtime bundle size optimizations) and this limitation was pointed out.
I was able to find 1 reference to the functionality here: #37677 (comment) However, I wasn't able to find a response to that question, so I figured filing a separate GitHub issue is better to facilitate the discussion.
The text was updated successfully, but these errors were encountered:
Suggestion
π Search Terms
"Private identifiers cannot be used as parameters"
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Allow private fields in parameter properties notation
π Motivating Example
π» Use Cases
Parameter property syntax saves quite a bit of boilerplate for class initialization, especially for large classes (which tends to be the case in the DevTools codebase). We are currently considering adopting private class fields in our codebase (for runtime bundle size optimizations) and this limitation was pointed out.
During my search, I did find https://github.com/microsoft/TypeScript/blob/663b19fe4a7c4d4ddaa61aedadd28da06acd27b6/tests/baselines/reference/privateNamesNotAllowedAsParameters.errors.txt which encodes the current behavior. The test appears to be coming from #30829, but I wasn't able to find a reference to the design decision for this functionality (the "load 214 more comments" throws 502 server errors on GitHub).
I was able to find 1 reference to the functionality here: #37677 (comment) However, I wasn't able to find a response to that question, so I figured filing a separate GitHub issue is better to facilitate the discussion.
The text was updated successfully, but these errors were encountered: