Skip to content

Consider using Object as type argument for generic parameters in place of dynamicΒ #30390

Open
@natebosch

Description

@natebosch

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 in new Set<String>.from(['foo']);. If instead the signature were Set.from(Iterable<Object> elements) this would be error free.

cc @leafpetersen

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.core-atype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions