Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2336503003: fix #25578, implement @covariant parameter overrides (Closed)
Patch Set: fix comments, format Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 717ef2ad6defb872ebb81583d30b6426aa750be3..928a408c62e15c7a3852e04b011e32f79f700eea 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -2491,7 +2491,6 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
DartType expectedStaticType,
ErrorCode errorCode) {
// TODO(leafp): Move the Downcast functionality here.
- // TODO(leafp): Support strict downcasts
if (!_expressionIsAssignableAtType(
expression, actualStaticType, expectedStaticType)) {
_errorReporter.reportTypeErrorForNode(
@@ -5038,10 +5037,10 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
FunctionType requiredMemberFT = _inheritanceManager
.substituteTypeArgumentsInMemberFromInheritance(
requiredMemberType, memberName, enclosingType);
- foundConcreteFT =
- _typeSystem.typeToConcreteType(_typeProvider, foundConcreteFT);
- requiredMemberFT =
- _typeSystem.typeToConcreteType(_typeProvider, requiredMemberFT);
+ foundConcreteFT = _typeSystem.functionTypeToConcreteType(
+ _typeProvider, foundConcreteFT);
+ requiredMemberFT = _typeSystem.functionTypeToConcreteType(
+ _typeProvider, requiredMemberFT);
if (_typeSystem.isSubtypeOf(foundConcreteFT, requiredMemberFT)) {
continue;
}
@@ -6229,11 +6228,10 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
bool _expressionIsAssignableAtType(Expression expression,
DartType actualStaticType, DartType expectedStaticType) {
bool concrete = _options.strongMode && checker.isKnownFunction(expression);
- if (concrete) {
- actualStaticType =
- _typeSystem.typeToConcreteType(_typeProvider, actualStaticType);
+ if (concrete && actualStaticType is FunctionType) {
+ actualStaticType = _typeSystem.functionTypeToConcreteType(
+ _typeProvider, actualStaticType);
// TODO(leafp): Move the Downcast functionality here.
- // TODO(leafp): Support strict downcasts
}
return _typeSystem.isAssignableTo(actualStaticType, expectedStaticType);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698