E2070 Syntax Errors

Syntax

wildcard type '?' is only allowed in function parameter and return types; not in variable declarations, struct fields, or enum types

When this occurs

This error is triggered when: wildcard type '?' is only allowed in function parameter and return types; not in variable declarations, struct fields, or enum types

Example error message

error[E2070]: wildcard type '?' is only allowed in function parameter and return types; not in variable declarations, struct fields, or enum types

How to fix

Review the error message and check your code at the indicated location. The message describes what went wrong — fix the underlying issue it identifies.

Related errors

No related errors.