-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.customer-vmlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.
Description
Consider this (simplified) example:
class RenderObject {}
class RenderClipPath extends RenderObject {}
class RenderCustomPaint extends RenderObject {}
class RenderObjectWidget {
void didUnmountRenderObject(covariant RenderObject _) {}
}
class ClipPath extends RenderObjectWidget {
void didUnmountRenderObject(RenderClipPath _) {}
}
class CustomPaint extends RenderObjectWidget {
void didUnmountRenderObject(RenderCustomPaint _) {}
}RenderObjectWidget.didUnmountRenderObject will have a type-check for it's argument even though it provably cannot fail. In general, if a parameter is declared covariant on a method which is not seen in the interface of any supertypes of its enclosing class, it doesn't need a type-check.
I'm working on fixing this on the VM-site, but the CFE should distinguish between parameters labeled "covariant" by the user and parameters which need to be checked due to declared-covariance.
Metadata
Metadata
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.customer-vmlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.