You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to have more options for type parameters. Specifically, it would be helpful for me if you could specify multiple types with an or and if you could make the type parameter required.
Example:
classMyClass<TextendsClassA || ClassB> {}
classMyClass<required T> {}
// goodfinal a =MyClass<ClassA>();
// bad => linter says type parameter is requiredfinal a =MyClass();
The text was updated successfully, but these errors were encountered:
A proposal specifically for union types in type parameter bounds (and nowhere else) might be useful. But if you're interested in union types in general, it's recommended that the discussion is kept in issues where that proposal is already being debated, in particular: #83.
it would be helpful for me if you could specify multiple types with an or [...]
This seems to be the same request as #83 (although the title says "sum type", the content of the issue talks about untagged union type, which is different) or #145. If this is the case, could we close this as a duplicate of one of this issues? If not, cold you elaborate on how your idea differs from #83 and #145?
it would be helpful for me [...] if you could make the type parameter required.
Seems to be related to #150, although it didn't propose any solution in language-level like you did... Maybe enabling stricter rules in the analysis_options.yaml file will suffice for you?
Edit: Sorry for repeating what @eernstg said, he was quicker than me hehe
It would be great to have more options for type parameters. Specifically, it would be helpful for me if you could specify multiple types with an
or
and if you could make the type parameterrequired
.Example:
The text was updated successfully, but these errors were encountered: