Skip to content

Commit 072e349

Browse files
committed
failing test
1 parent 4c8452b commit 072e349

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

tests/specs/graph/fast_check/test_test_test.txt

+17-18
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
]
1212

1313
# mod.ts
14-
export function a() {
15-
var x = "";
16-
return {} as typeof x;
17-
};
14+
// export function a() {
15+
// var x = "";
16+
// return {} as typeof x;
17+
// };
1818

19-
export function a(b: string): typeof b {
19+
export const a = (b: string, c = {} as typeof b) => {
2020
};
2121

2222
# output
@@ -27,7 +27,7 @@ export function a(b: string): typeof b {
2727
"modules": [
2828
{
2929
"kind": "esm",
30-
"size": 65,
30+
"size": 144,
3131
"mediaType": "TypeScript",
3232
"specifier": "file:///mod.ts"
3333
}
@@ -36,19 +36,18 @@ export function a(b: string): typeof b {
3636
}
3737

3838
Fast check file:///mod.ts:
39-
error[unknown-return-type]: unknown return type for function in the public API
40-
--> /mod.ts:1:17
41-
|
42-
1 | export function a () {
43-
| - this function's return type could not be inferred
39+
error[unknown-var-type]: unknown type for variable in the public API
40+
--> /mod.ts:6:14
4441
|
45-
3 | return {} as typeof x;
46-
| ------ because the value returned here
47-
| - contains this reference to a local variable or type
42+
6 | export const a = (b: string, c = {} as typeof b): typeof b => {
43+
| ^ this variable's type could not be inferred because its initializer
44+
| - contains this arrow expression
45+
| - which has this parameter, which is missing an explicit type annotation
46+
| - contains this reference to a local variable or type
4847
|
49-
= hint: add an explicit return type to the function
48+
= hint: add an explicit type annotation to the arrow expression parameter in the variable declaration initializer
5049

51-
info: all functions in the public API must have an known return type
52-
info: local variables or types can not be referenced because they are not visible at the top level of the module
53-
docs: https://jsr.io/go/slow-type-unknown-return-type
50+
info: all variables in the public API must have a known type
51+
info: local variables or types can not be referenced in the public API because they are not visible at the top level of the module
52+
docs: https://jsr.io/go/slow-type-unknown-var-type
5453

0 commit comments

Comments
 (0)