Slightly less conservative check in isConstraintPosition#46526
Slightly less conservative check in isConstraintPosition#46526ahejlsberg merged 2 commits intomainfrom
Conversation
|
@typescript-bot test this |
|
Heya @ahejlsberg, I've started to run the inline community code test suite on this PR at 042debb. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 042debb. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the extended test suite on this PR at 042debb. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at 042debb. You can monitor the build here. Update: The results are in! |
|
@ahejlsberg Here they are:Comparison Report - main..46526
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@ahejlsberg |
|
Tests look good and performance not affected. I think this one is good to go. |
| function update<T extends Control, K extends keyof T>(control : T | undefined, key: K, value: T[K]): void { | ||
| if (control !== undefined) { | ||
| control[key] = value; | ||
| } |
There was a problem hiding this comment.
Can a subsequent else if discriminate between Button and Checkbox, or are we now stuck with T?
There was a problem hiding this comment.
In a subsequent else if the type of control would be undefined. But if you mean a subsequent if inside the block, then yes:
if (control !== undefined) { // Type of control is T | undefined
control[key] = value; // Type of control is T
if (control.type === "button") { // Type of control is Control
control.text; // Type of control is Button
}
}…6526) * Slight adjustment to check in isConstraintPosition * Add regression test
Fixes #46495.