mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
27 lines
376 B
TypeScript
27 lines
376 B
TypeScript
|
// @Filename: a.js
|
||
|
// @noEmit: true
|
||
|
// @allowJs: true
|
||
|
// @checkJs: true
|
||
|
// @strict: true
|
||
|
/** @param {number=} a */
|
||
|
function f(a) {
|
||
|
a = 1
|
||
|
a = null // should not be allowed
|
||
|
a = undefined
|
||
|
}
|
||
|
f()
|
||
|
f(null) // should not be allowed
|
||
|
f(undefined)
|
||
|
f(1)
|
||
|
|
||
|
/** @param {???!?number?=} a */
|
||
|
function g(a) {
|
||
|
a = 1
|
||
|
a = null
|
||
|
a = undefined
|
||
|
}
|
||
|
g()
|
||
|
g(null)
|
||
|
g(undefined)
|
||
|
g(1)
|