mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-19 12:45:58 -05:00
Fixed braceless type tags with types starting with an open parenthesis (#57167)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
bdd1f947f6
commit
9ba0800646
26
tests/cases/compiler/jsdocBracelessTypeTag1.ts
Normal file
26
tests/cases/compiler/jsdocBracelessTypeTag1.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// @strict: true
|
||||
// @noEmit: true
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @filename: index.js
|
||||
|
||||
/** @type () => string */
|
||||
function fn1() {
|
||||
return 42;
|
||||
}
|
||||
|
||||
/** @type () => string */
|
||||
function fn2() {
|
||||
return "foo";
|
||||
}
|
||||
|
||||
/** @type (arg: string) => string */
|
||||
function fn3(arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
/** @type ({ type: 'foo' } | { type: 'bar' }) & { prop: number } */
|
||||
const obj1 = { type: "foo", prop: 10 };
|
||||
|
||||
/** @type ({ type: 'foo' } | { type: 'bar' }) & { prop: number } */
|
||||
const obj2 = { type: "other", prop: 10 };
|
||||
Reference in New Issue
Block a user