-
Notifications
You must be signed in to change notification settings - Fork 161
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
Cannot instatiate view with type parameter #8371
Comments
While I agree that this case shouldn't cause an exception, I'm still a bit curious to understand what the purpose is for having an unbound type parameter in a concrete view? |
@Legioth, I understand they implemented the view using reflection. Different kinds of objects are retrieved depending on a parameter. This approach provides some weak type-safety, for instance, when implementing a helper method that returns one of those objects or receives it as a parameter (even though the actual type after erasure is |
That would be the case if you'd bind the type parameter, i.e. something like this:
In this example, the type parameter is unbound which basically means that it serves no purpose for the view itself. There might be a benefit from outside code that interacts with it, e.g. something like this:
|
It can also be used internally (maybe not a strong case, I agree):
|
Just to clarify : any example here is invalid if it's a standalone.
The only correct usage here is subclassing of But |
Vaadin 14.1.28. Starting an application that contains the following view fails with the exception listed below. If the view doesn't implement
HasUrlParameter
the application starts correctly.The text was updated successfully, but these errors were encountered: