Keep accessors as accessors in emitted anonymous class declarations#60853
Conversation
d466c50 to
1baa828
Compare
| } | ||
| if (!singleProp) { | ||
| singleProp = prop; | ||
| propFlags = (prop.flags & SymbolFlags.Accessor) || SymbolFlags.Property; |
There was a problem hiding this comment.
Perhaps the accessor case should be handled through checkFlags. I'm worried that it would require looking carefully at all call sites that handle accessors to cover for this new case - but maybe I'm worried about it prematurely. Anyway, let me know what you think about it ;)
src/compiler/checker.ts
Outdated
| // classes created by mixins are represented as intersections and overriding a property in a derived class redefines it completely at runtime | ||
| // so a get accessor can't be merged with a set accessor in a base class, for that reason the accessor flags are only used when they are the same in all consistuents |
There was a problem hiding this comment.
perhaps if I'd use a new CheckFlags.SyntheticAccessor that wouldn't really matter as much? I'm not sure if it's even that important of a rule to begin with, I just erred on the safer side of things and maintained the current behavior for this ambiguous case
…essors-on-emitted-anonymous-class-declarations
bfbf4b6 to
b43f9dd
Compare
|
Doubtful this will catch anything, but @typescript-bot test it |
|
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
|
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
fixes #60672
fixes #44938
fixes #58790
fixes #61967