-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Milestone
Description
π Search Terms
ts4094, abstract, class, property, protected, private
π Version & Regression Information
- This is a crash
- Happens in the 5.6-dev, 5.x, 4.x, etc
β― Playground Link
π» Code
Cloneable repo: https://github.com/paulmillr/ts-bug-4094.
So there's abstract class which declares protected property (https://github.com/paulmillr/noble-hashes/blob/main/src/_md.ts#L33):
export abstract class HashMD<T extends HashMD<T>> extends Hash<T> {
protected buffer: Uint8Array;
}The class is subclassed (https://github.com/paulmillr/noble-hashes/blob/e804a2f9eff77c92e21705f876d99c3069037988/src/sha256.ts#L31C1-L32C1):
class SHA256 extends HashMD<SHA256> {}The protected buffer property is not used as emit type anywhere.
π Actual behavior
It doesn't compile, error emitted: TS4094: Property 'buffer' of exported class expression may not be private or protected
π Expected behavior
It should compile
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug