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

Wrong return type #1982

Closed
falsandtru opened this issue Jun 21, 2023 · 4 comments · Fixed by #1985
Closed

Wrong return type #1982

falsandtru opened this issue Jun 21, 2023 · 4 comments · Fixed by #1985
Assignees

Comments

@falsandtru
Copy link

Explained in #1971.

// ok
const a: object = t('friend', { returnObjects: true });
// ok but should be an error
const b: string = t('friend', { returnObjects: true });
@pedrodurek
Copy link
Member

We could constraint the return type to be object only when returnObjects: true, but I'm against doing the same if returnObject is set to true inside the CustomOptionTypes since it applies globally.

Up to you to decide @adrai

@adrai
Copy link
Member

adrai commented Jun 22, 2023

sounds reasonable

@adrai
Copy link
Member

adrai commented Jun 22, 2023

probably also returnDetails

@pedrodurek
Copy link
Member

returnDetails is already behaving correctly 😄

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

Successfully merging a pull request may close this issue.

3 participants