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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart

Issue 2967923002: Use type variables on Typedef correctly. (Closed)
Patch Set: Fix NPE and change compile-time error to warning. Created 3 years, 5 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
Index: pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart
index 55ed848eef30eafc97c2189ba099c98cdb9b606f..e0472a2d03a99db9d70604d592e3849b83180d7d 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart
@@ -33,11 +33,11 @@ class KernelTypeVariableBuilder
DartType buildType(
LibraryBuilder library, List<KernelTypeBuilder> arguments) {
if (arguments != null) {
- return inputError(null, null,
- "Can't use type arguments with type parameter $parameter");
- } else {
- return new TypeParameterType(parameter);
+ library.addWarning(arguments.first.charOffset,
ahe 2017/07/05 07:55:24 This test uses a type variable with arguments and
+ "Can't use type arguments with type parameter $parameter",
+ fileUri: fileUri);
}
+ return new TypeParameterType(parameter);
}
DartType buildTypesWithBuiltArguments(
@@ -55,6 +55,7 @@ class KernelTypeVariableBuilder
}
void finish(LibraryBuilder library, KernelClassBuilder object) {
- parameter.bound = bound?.build(library) ?? object.buildType(library, null);
+ parameter.bound ??=
+ bound?.build(library) ?? object.buildType(library, null);
}
}

Powered by Google App Engine
This is Rietveld 408576698