Consider using Object as type argument for generic parameters in place of dynamic #30390
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
core-a
type-enhancement
A request for a change that isn't a bug
This is mainly coming up because of how it interacts with
--no-implicit-dynamic
. We're considering enabling that flag in more places because it's helping us catch bugs - but it also interacts poorly with signatures that take generic classes with<dynamic>
I'm not sure how many APIs are impacted here but we can take one example: the
Set.from
constructor:As it is,
Set.from(Iterable elements)
there is an implicit dynamic error innew Set<String>.from(['foo']);
. If instead the signature wereSet.from(Iterable<Object> elements)
this would be error free.cc @leafpetersen
The text was updated successfully, but these errors were encountered: