Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Type check before callable ignore in callable #2

Open
Arcoz0308 opened this issue Jun 10, 2023 · 2 comments
Open

Type check before callable ignore in callable #2

Arcoz0308 opened this issue Jun 10, 2023 · 2 comments

Comments

@Arcoz0308
Copy link

Arcoz0308 commented Jun 10, 2023

image

test.ts :

import {resultify} from "rustic-error";

type a = {
    bar(): string;
}
type b = {
    foo: a|null
}

const bFoo: b = {
    foo: {
        bar(): string {
            return 'Joe doe'
        }
    }
}
if (bFoo.foo !== null) {
    const bar1 = bFoo.foo.bar();
    const bar2 = resultify(() => bFoo.foo.bar());
}

tsconfig.json :

{
  "compilerOptions": {
    "target": "es2022",
    "module": "commonjs",
    "strict": true,
  }
}

solution that can remove error, but not pratical :

if (bFoo.foo !== null) {
    const bar1 = bFoo.foo.bar();
    const foo = bFoo.foo
    const bar2 = resultify(() => foo.bar());
}
@Arcoz0308
Copy link
Author

update ?

@Bluzzi
Copy link
Owner

Bluzzi commented Feb 17, 2024

We are currently testing this package on a large-scale project in order to understand its strengths and weaknesses. We also want to concentrate on the new version of our ESLint config before getting back to developing the organisation's other projects.

After these two things, we're going to actively resume the development of this package and resolve the open issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants