-
Notifications
You must be signed in to change notification settings - Fork 25
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
Issues with @spec! on auto-generated type like TypedEctoSchema #172
Comments
Hi there! TypeCheck's checking functionality requires functions that return TypeCheck structs to exist as well as specs. This is necessary because these structs capture a lot of metadata that cannot be found in plain specs by themselves. TypeCheck.External exists which tries to turn plain specs into TypeCheck structs, but it by necessity works on a 'best-effort' basis, and it cannot be combined with the You're not the first person who'd like to integrate TypeCheck and TypedEctoSchema. There is a work-in-progress PR on the TypedEctoSchema repo to enable the automatic creation of TypeCheck types from a call to Until this PR is finished, the following workarounds exist:
|
That's awesome! Thanks a bunch for the in-depth reply @Qqwy. I checked for issues in the TypeCheck repo, but failed to find any. I'll close this issue hoping that it's OK, since there's already a PR in progress in the TypedEctoSchema repo. |
Hi there,
TypeCheck looks really interesting, but I'm afraid I'm having some issues when trying to make use of it.
I'm trying to use it together with TypedEctoSchema, but I'm getting compile errors. Could this possibly be because TypeCheck "runs before" TypedEctoSchema gets the chance to generate the typespecs? Any workaround available?
Actual behaviour
I get a
function Xxx.User.t/0 is undefined or private' error.
when using TypeCheck together with TypedEctoSchemaExpected behaviour
TypeCheck should work with auto-generated typespecs like those coming from TypedEctoSchema.
Example code
The text was updated successfully, but these errors were encountered: