mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Accepted baselines.
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(3,9): error TS2367: This condition will always return 'false' since the types '"foo"' and '"baz"' have no overlap.
|
||||
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(3,19): error TS2352: Conversion of type 'bar' to type '"baz"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(4,20): error TS2352: Conversion of type 'bar' to type '"foo"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,9): error TS2367: This condition will always return 'false' since the types 'string' and 'number' have no overlap.
|
||||
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,19): error TS2352: Conversion of type 'string' to type 'number' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts (3 errors) ====
|
||||
==== tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts (5 errors) ====
|
||||
type EnhancedString = string & { enhancements: any };
|
||||
|
||||
var a = "foo" === "bar" as "baz";
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2367: This condition will always return 'false' since the types '"foo"' and '"baz"' have no overlap.
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2352: Conversion of type 'bar' to type '"baz"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
var b = "foo" !== ("bar" as "foo");
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2352: Conversion of type 'bar' to type '"foo"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
var c = "foo" == (<number>"bar");
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2367: This condition will always return 'false' since the types 'string' and 'number' have no overlap.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(3,9): error TS2352: Conversion of type 'foo' to type '"bar"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(4,9): error TS2352: Conversion of type 'bar' to type '"foo"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts (2 errors) ====
|
||||
let fooOrBar: "foo" | "bar";
|
||||
|
||||
let a = "foo" as "bar";
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2352: Conversion of type 'foo' to type '"bar"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
let b = "bar" as "foo";
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2352: Conversion of type 'bar' to type '"foo"' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
let c = fooOrBar as "foo";
|
||||
let d = fooOrBar as "bar";
|
||||
let e = fooOrBar as "baz";
|
||||
let f = "baz" as typeof fooOrBar;
|
||||
Reference in New Issue
Block a user