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

Add generic to Reference.create() #1208

Merged
merged 1 commit into from
Jan 5, 2021
Merged

Add generic to Reference.create() #1208

merged 1 commit into from
Jan 5, 2021

Conversation

florianeckerstorfer
Copy link
Contributor

@florianeckerstorfer florianeckerstorfer commented Jan 5, 2021

The create() method in Reference.ts was missing the generic, which caused a type error in the following example

yup
  .object({
    availableFrom: yup.number(),
    availableTo: yup
      .number()
      .moreThan(yup.ref('availableFrom')),
  });

Error:

Argument of type 'Reference<unknown>' is not assignable to parameter of type 'number | Reference<number>'.

In this PR I add a generic to the create() method and type Reference and ReferenceOptions with it.

@jquense jquense merged commit be3d1b4 into jquense:master Jan 5, 2021
@jquense
Copy link
Owner

jquense commented Jan 5, 2021

thanks!

@dschaller
Copy link

Is this fix going to be available in 0.38.x?

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

Successfully merging this pull request may close these issues.

None yet

3 participants