TypeScript/tests/cases/conformance/directives/ts-expect-error.ts
Josh Goldberg be2eb8a2e1
Allowed comment directives to be multiline (#38228)
* Allowed comment directives to be multiline

* Added tests, and perhaps fixed a test runner bug?

* I think it's going to need a consistent variable to loop over

* Used dynamically computed indexes in verifies

* Added multiline tests

* Increased flexibility for multiline comment parsing

* Undid a couple of formatting changes; removed backslashes from multiline regexp

* Added baseline tests for multiline comment skipping

Co-authored-by: Orta Therox <orta.therox@gmail.com>
2020-05-06 13:09:29 -07:00

40 lines
1.1 KiB
TypeScript

// @ts-expect-error additional commenting
var invalidCommentedFancySingle: number = 'nope';
/*
@ts-expect-error additional commenting */
var invalidCommentedFancyMulti: number = 'nope';
// @ts-expect-error additional commenting
var validCommentedFancySingle: string = 'nope';
/* @ts-expect-error additional commenting */
var validCommentedFancyMulti: string = 'nope';
// @ts-expect-error
var invalidCommentedPlainSingle: number = 'nope';
/*
@ts-expect-error */
var invalidCommentedPlainMulti: number = 'nope';
// @ts-expect-error
var validCommentedPlainSingle: string = 'nope';
/* @ts-expect-error */
var validCommentedPlainMulti1: string = 'nope';
/*
@ts-expect-error */
var validCommentedPlainMulti2: string = 'nope';
var invalidPlain: number = 'nope';
var validPlain: string = 'nope';
// @ts-expect-error
(({ a: true } as const).a === false); // <-- compiles (as expected via comment)
(({ a: true } as const).a === false); // Should error
(({ a: true } as const).a === false); // error
(({ a: true } as const).a === false); // error