Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript: NoImplicitReturns support #81

Closed
MeFisto94 opened this issue Mar 5, 2023 · 1 comment
Closed

TypeScript: NoImplicitReturns support #81

MeFisto94 opened this issue Mar 5, 2023 · 1 comment
Labels
Fixed fixed, wait for next release.

Comments

@MeFisto94
Copy link

When "noImplicitReturns": true, in the tsconfig.json, then at least the misc.ts yields a compiler error:

    cv.toMatTypeName = (type: number): MatTypes | undefined => {
        for (const t of allTypes) {
            if (cv[t] === type) return t;
        }
    };

Here, in case the type couldn't be found, we'd need to explicitly return undefined

@UrielCh
Copy link
Owner

UrielCh commented Mar 6, 2023

Patched as:

cv.toMatTypeName = (type: number): MatTypes | undefined => {
    for (const t of allTypes) {
        if (cv[t] === type) return t;
    }
    return undefined;
};

@UrielCh UrielCh added the Fixed fixed, wait for next release. label Mar 6, 2023
@UrielCh UrielCh closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed fixed, wait for next release.
Projects
None yet
Development

No branches or pull requests

2 participants