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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/constants.dart

Issue 132313012: Fix typechecks for constant assignments of function to typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file for analyzer. Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dart2js; 5 part of dart2js;
6 6
7 abstract class ConstantVisitor<R> { 7 abstract class ConstantVisitor<R> {
8 R visitFunction(FunctionConstant constant); 8 R visitFunction(FunctionConstant constant);
9 R visitNull(NullConstant constant); 9 R visitNull(NullConstant constant);
10 R visitInt(IntConstant constant); 10 R visitInt(IntConstant constant);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (other is !FunctionConstant) return false; 68 if (other is !FunctionConstant) return false;
69 return identical(other.element, element); 69 return identical(other.element, element);
70 } 70 }
71 71
72 String toString() => element.toString(); 72 String toString() => element.toString();
73 List<Constant> getDependencies() => const <Constant>[]; 73 List<Constant> getDependencies() => const <Constant>[];
74 DartString toDartString() { 74 DartString toDartString() {
75 return new DartString.literal(element.name); 75 return new DartString.literal(element.name);
76 } 76 }
77 77
78 DartType computeType(Compiler compiler) { 78 // TODO(johnniwinther): remove computeType.
79 return compiler.functionClass.computeType(compiler); 79 DartType computeType(Compiler compiler) => element.computeType(compiler);
80 }
81 80
82 ti.TypeMask computeMask(Compiler compiler) { 81 ti.TypeMask computeMask(Compiler compiler) {
83 return compiler.typesTask.functionType; 82 return compiler.typesTask.functionType;
84 } 83 }
85 84
86 int get hashCode => (17 * element.hashCode) & 0x7fffffff; 85 int get hashCode => (17 * element.hashCode) & 0x7fffffff;
87 86
88 accept(ConstantVisitor visitor) => visitor.visitFunction(this); 87 accept(ConstantVisitor visitor) => visitor.visitFunction(this);
89 } 88 }
90 89
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 if (i > 0) sb.write(','); 632 if (i > 0) sb.write(',');
634 sb.write(Error.safeToString(field.name)); 633 sb.write(Error.safeToString(field.name));
635 sb.write('='); 634 sb.write('=');
636 sb.write(Error.safeToString(value)); 635 sb.write(Error.safeToString(value));
637 i++; 636 i++;
638 }); 637 });
639 sb.write('))'); 638 sb.write('))');
640 return sb.toString(); 639 return sb.toString();
641 } 640 }
642 } 641 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698