Skip to content

Commit

Permalink
failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed May 17, 2024
1 parent 4c8452b commit 072e349
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions tests/specs/graph/fast_check/test_test_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
]

# mod.ts
export function a() {
var x = "";
return {} as typeof x;
};
// export function a() {
// var x = "";
// return {} as typeof x;
// };

export function a(b: string): typeof b {
export const a = (b: string, c = {} as typeof b) => {
};

# output
Expand All @@ -27,7 +27,7 @@ export function a(b: string): typeof b {
"modules": [
{
"kind": "esm",
"size": 65,
"size": 144,
"mediaType": "TypeScript",
"specifier": "file:///mod.ts"
}
Expand All @@ -36,19 +36,18 @@ export function a(b: string): typeof b {
}

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

info: all functions in the public API must have an known return type
info: local variables or types can not be referenced because they are not visible at the top level of the module
docs: https://jsr.io/go/slow-type-unknown-return-type
info: all variables in the public API must have a known type
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
docs: https://jsr.io/go/slow-type-unknown-var-type

0 comments on commit 072e349

Please sign in to comment.