-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Return type as generic base class is not allowed #2283
Comments
Hi, Please provide the full code that triggers the error you are getting. I'm getting:
There's nothing we can do with that to help you. |
@asterite I just simplified problem on the description and include a carc.in link to it. |
The generics class model have some pitfalls. Inheriting from a generic class I think is the problematic thing currently. Composition instead of inheritance might offer a workaround. https://carc.in/#/r/tv9 https://carc.in/#/r/tvc |
Might be related to #846 |
Yes, inheriting from a generic class will probably won't work in many cases, so for now I'd advice not to use that "feature". We'll probably fix that once type annotations of instance variables are mandatory. Chances of fixing this before that point are very low. |
Closed in favor of #2665 |
I have a method which returns an object typed
ParserThen(Array(Something), Array(Something))
and its parent class isParser(Array(Something))
but compiler complains about its type. I simplified the problem.https://carc.in/#/r/tut
The text was updated successfully, but these errors were encountered: