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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart

Issue 2952313002: Implement type inference for type literals (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.fasta_accessors; 5 library fasta.fasta_accessors;
6 6
7 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' 7 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
8 show 8 show
9 KernelArguments, 9 KernelArguments,
10 KernelComplexAssignment, 10 KernelComplexAssignment,
11 KernelIndexAssign, 11 KernelIndexAssign,
12 KernelPropertyAssign, 12 KernelPropertyAssign,
13 KernelStaticAssignment, 13 KernelStaticAssignment,
14 KernelThisExpression, 14 KernelThisExpression,
15 KernelTypeLiteral,
15 KernelVariableAssignment; 16 KernelVariableAssignment;
16 17
17 import 'package:front_end/src/fasta/kernel/utils.dart' show offsetForToken; 18 import 'package:front_end/src/fasta/kernel/utils.dart' show offsetForToken;
18 19
19 import 'package:front_end/src/scanner/token.dart' show Token; 20 import 'package:front_end/src/scanner/token.dart' show Token;
20 21
21 import 'frontend_accessors.dart' show Accessor; 22 import 'frontend_accessors.dart' show Accessor;
22 23
23 import 'package:front_end/src/fasta/type_inference/type_promotion.dart' 24 import 'package:front_end/src/fasta/type_inference/type_promotion.dart'
24 show TypePromoter; 25 show TypePromoter;
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 if (declaration is KernelInvalidTypeBuilder) { 948 if (declaration is KernelInvalidTypeBuilder) {
948 KernelInvalidTypeBuilder declaration = this.declaration; 949 KernelInvalidTypeBuilder declaration = this.declaration;
949 String message = declaration.message; 950 String message = declaration.message;
950 helper.library.addWarning(declaration.charOffset, message, 951 helper.library.addWarning(declaration.charOffset, message,
951 fileUri: declaration.fileUri); 952 fileUri: declaration.fileUri);
952 helper.warning(message, offset); 953 helper.warning(message, offset);
953 super.expression = new Throw( 954 super.expression = new Throw(
954 new StringLiteral(message)..fileOffset = offsetForToken(token)) 955 new StringLiteral(message)..fileOffset = offsetForToken(token))
955 ..fileOffset = offset; 956 ..fileOffset = offset;
956 } else { 957 } else {
957 super.expression = 958 super.expression = new KernelTypeLiteral(
958 new TypeLiteral(buildType(null, nonInstanceAccessIsError: true)) 959 buildType(null, nonInstanceAccessIsError: true))
959 ..fileOffset = offsetForToken(token); 960 ..fileOffset = offsetForToken(token);
960 } 961 }
961 } 962 }
962 return super.expression; 963 return super.expression;
963 } 964 }
964 965
965 Expression makeInvalidWrite(Expression value) { 966 Expression makeInvalidWrite(Expression value) {
966 return buildThrowNoSuchMethodError( 967 return buildThrowNoSuchMethodError(
967 new NullLiteral()..fileOffset = offsetForToken(token), 968 new NullLiteral()..fileOffset = offsetForToken(token),
968 new Arguments(<Expression>[value])..fileOffset = value.fileOffset, 969 new Arguments(<Expression>[value])..fileOffset = value.fileOffset,
969 isSetter: true); 970 isSetter: true);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 offset ??= offsetForToken(this.token); 1046 offset ??= offsetForToken(this.token);
1046 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset, 1047 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset,
1047 plainNameForRead, arguments, offset, 1048 plainNameForRead, arguments, offset,
1048 isGetter: isGetter, isSetter: isSetter); 1049 isGetter: isGetter, isSetter: isSetter);
1049 } 1050 }
1050 } 1051 }
1051 1052
1052 bool isFieldOrGetter(Member member) { 1053 bool isFieldOrGetter(Member member) {
1053 return member is Field || (member is Procedure && member.isGetter); 1054 return member is Field || (member is Procedure && member.isGetter);
1054 } 1055 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698