-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Predefined Input can not be assigned to InputSource
when using with TypeScript < 4.7
#62
Comments
Addition: Code that fails: |
You can see it working fine in stackblitz (here). It also works fine for me locally. Are you getting this locally, or just in codesandbox (which seems to be using TS 4.4)? If so, what is your local TypeScript version? |
I get this locally with 4.6.3 as well. |
Yes - confirmed. You need features from TS 4.7+; versions below that show this error. |
Predefined Input can not be assigned to InputSource
when using with TypeScript < 7.4
Excuse the question, but am I supposed to to something with the ticket? |
@tim3trick No need to do anything. For now you can use a newer version of TypeScript. I'll keep this open until I've had a chance to see whether it's possible to make the features of this library work with earlier versions of TS or whether I should instead mention it in the README. |
Predefined Input can not be assigned to InputSource
when using with TypeScript < 7.4Predefined Input can not be assigned to InputSource
when using with TypeScript < 4.7
I just installed magic-regexp via
yarn add magic-regexp
and tried the first example from https://regexp.dev/getting-started/examplesTypescript does not like it though:
Argument of type 'Input<"\\d", never>' is not assignable to parameter of type 'InputSource<string, never>'.
The code can also be simplified even more:
const regex = createRegExp(oneOrMore(digit));
I have created a codesandbox for showcasing this: https://codesandbox.io/s/gracious-swartz-3sdfcs
The text was updated successfully, but these errors were encountered: