Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

GenerateInjector should fail more gracefully on non-classes #1633

Closed
matanlurey opened this issue Oct 8, 2018 · 0 comments
Closed

GenerateInjector should fail more gracefully on non-classes #1633

matanlurey opened this issue Oct 8, 2018 · 0 comments

Comments

@matanlurey
Copy link
Contributor

The following syntax:

typedef SomeFunctionType = void Function();

@GenerateInjector([
  SomeFunctionType
])

... is syntactically, but not semantically valid.

A naked type (i.e. SomeFunctionType) is an alias for ClassProvider(SELF).

A ClassProvider is not valid on a function type.

alorenzen pushed a commit that referenced this issue Oct 8, 2018
Previously, we would give a mysterious type error attempting to cast to ClassElement. We also now include the file entrypoint being parsed, and the source of the type itself in the error message.

Closes #1633.

PiperOrigin-RevId: 216255169
alorenzen pushed a commit that referenced this issue Oct 8, 2018
Previously, we would give a mysterious type error attempting to cast to ClassElement. We also now include the file entrypoint being parsed, and the source of the type itself in the error message.

Closes #1633.

PiperOrigin-RevId: 216255169
alorenzen pushed a commit that referenced this issue Oct 8, 2018
Previously, we would give a mysterious type error attempting to cast to ClassElement. We also now include the file entrypoint being parsed, and the source of the type itself in the error message.

Closes #1633.

PiperOrigin-RevId: 216255169
alorenzen pushed a commit that referenced this issue Oct 8, 2018
Previously, we would give a mysterious type error attempting to cast to ClassElement. We also now include the file entrypoint being parsed, and the source of the type itself in the error message.

Closes #1633.

PiperOrigin-RevId: 216255169
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant