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

0.8.18 regression - "type annotations needed" on variantless enum #287

Closed
kmdreko opened this issue May 6, 2024 · 1 comment
Closed

Comments

@kmdreko
Copy link

kmdreko commented May 6, 2024

This code fails with version 0.8.18 of schemars:

use schemars::JsonSchema;

#[derive(JsonSchema)]
pub enum MyEnum {}
error[E0282]: type annotations needed
   --> src/main.rs:3:10
    |
698 | #[derive(JsonSchema)]
    |          ^^^^^^^^^^ cannot infer type
    |
    = note: this error originates in the derive macro `JsonSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

Discovered from scale-info library: https://github.com/paritytech/scale-info/blob/3082edc2ae96de53c1ba104b8423451a9a485d1b/src/form.rs#L64-L67

@kmdreko kmdreko changed the title 0.18.8 regression - "type annotations needed" on variantless enum 0.8.18 regression - "type annotations needed" on variantless enum May 6, 2024
@GREsau GREsau closed this as completed in 1a40d1b May 6, 2024
@GREsau
Copy link
Owner

GREsau commented May 6, 2024

Thanks for the report, this should now be fixed in 0.8.19 🙂

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

No branches or pull requests

2 participants