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

Unified Diff: lib/type_environment.dart

Issue 2465893002: Add strong mode type checking pass. (Closed)
Patch Set: Merge with master and remove visitBlockExpression Created 4 years, 1 month 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 | « lib/type_checker.dart ('k') | test/baseline_spec_mode_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/type_environment.dart
diff --git a/lib/type_environment.dart b/lib/type_environment.dart
index dcb74a4687aad5e8e2b46f87b86bbea6ddc34529..47b1c285e867c1580b6cc172e42e9518f6570523 100644
--- a/lib/type_environment.dart
+++ b/lib/type_environment.dart
@@ -13,7 +13,10 @@ typedef void ErrorHandler(TreeNode node, String message);
class TypeEnvironment extends SubtypeTester {
final CoreTypes coreTypes;
final ClassHierarchy hierarchy;
- DartType thisType;
+ InterfaceType thisType;
+
+ DartType returnType;
+ DartType yieldType;
/// An error handler for use in debugging, or `null` if type errors should not
/// be tolerated. See [typeError].
@@ -35,11 +38,11 @@ class TypeEnvironment extends SubtypeTester {
Class get intClass => coreTypes.intClass;
Class get numClass => coreTypes.numClass;
- InterfaceType listType(DartType elementType) {
+ InterfaceType literalListType(DartType elementType) {
return new InterfaceType(coreTypes.listClass, <DartType>[elementType]);
}
- InterfaceType mapType(DartType key, DartType value) {
+ InterfaceType literalMapType(DartType key, DartType value) {
return new InterfaceType(coreTypes.mapClass, <DartType>[key, value]);
}
@@ -128,7 +131,7 @@ abstract class SubtypeTester {
return true;
}
if (subtype is InterfaceType && supertype is InterfaceType) {
- InterfaceType upcastType =
+ var upcastType =
hierarchy.getTypeAsInstanceOf(subtype, supertype.classNode);
if (upcastType == null) return false;
for (int i = 0; i < upcastType.typeArguments.length; ++i) {
« no previous file with comments | « lib/type_checker.dart ('k') | test/baseline_spec_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698