-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different comment values in TSC CLI and test file, Which one should We trust? #1005
Comments
I think |
In the absence of an https://github.com/dudykr/stc/blob/main/crates/stc_ts_type_checker/tests/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.error-diff.json |
If you're right, and if TSC's findings are correct, the error is not an extra error, but it is being labeled as an extra error(Line 9). Lines 7 to 15 in 7c76ed2
Lines 21 to 26 in 7c76ed2
|
I'm considering using the result of |
It will be similar to #1040 |
I think so, too Unfortunately, the only official specification is tsc cli Also, if the specification of tsc cli is changed, it will be casue that a lot of code will get type error ps. We have some additional extra errors that occurred for similar reasons |
Same issue #413 |
A bit confusing type check here...
I suppose, it's from theese test cases? |
@ankhzet Lines 21 to 26 in 693cf5a
this code should not work type guard, but comment mean work type guard The comment is also attached to the recent typescript test code. |
Ok, got it. |
The essence of this issue is what to do when the results of the TSC differ from the test annotations. In fact, line 25 is inferred to be string | C. if (typeof strOrC === "Object") {
c = strOrC; // C
}
else {
strOrC; // expected string, but this type is string | C
var r2: string = strOrC;
} |
As far as i understand, the test was written when So the issue might be a discrepancy between the tsconfig used for reference tests execution ty the TS team and the default tsc/playground config you usually use for testing, i guess. |
omg, thanks your report Issue has been created in relation to it. |
The reason for the discussion of the issue is deemed to have disappeared, so we close it. |
what is the value of
strOrC
at thevar r2: string = strOrC
The text was updated successfully, but these errors were encountered: