Factory Methods w/ Generic Arguments #30041
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
type-enhancement
A request for a change that isn't a bug
Uh oh!
There was an error while loading. Please reload this page.
Hello, not sure if this has come up before so I thought I'd file an issue! I'm implementing a Library and have found that I need two types of constructors: normal
factory
constructors for most parts, but I needstatic
constructors when I need to work with generic parameters.This leads to a slightly awkward API as constructors work like
new MyClass.createSomething()
methods, but others have to beMyClass.createSomething()
without thenew
keyword indicating you're constructing a new object.Perhaps it's easier to demonstrate with code, thanks for any info!
The text was updated successfully, but these errors were encountered: