OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library fletchc.fletch_constants; | 5 library fletchc.fletch_constants; |
6 | 6 |
7 import 'package:compiler/src/constants/expressions.dart' show | 7 import 'package:compiler/src/constants/expressions.dart' show |
8 ConstantExpression; | 8 ConstantExpression; |
9 | 9 |
10 import 'package:compiler/src/constants/values.dart' show | 10 import 'package:compiler/src/constants/values.dart' show |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 accept(visitor, arg) { | 53 accept(visitor, arg) { |
54 throw new UnsupportedError("FletchClassConstant.accept"); | 54 throw new UnsupportedError("FletchClassConstant.accept"); |
55 } | 55 } |
56 | 56 |
57 String unparse() => toStructuredString(); | 57 String unparse() => toStructuredString(); |
58 | 58 |
59 String toStructuredString() { | 59 String toStructuredString() { |
60 return 'FletchClassConstant($classId)'; | 60 return 'FletchClassConstant($classId)'; |
61 } | 61 } |
62 } | 62 } |
63 | |
64 class FletchClassInstanceConstant extends ConstantValue { | |
ahe
2015/04/07 15:00:11
Why is this needed?
Anders Johnsen
2015/04/08 06:32:14
Because we create artificial constants, not presen
| |
65 final int classId; | |
66 | |
67 FletchClassInstanceConstant(this.classId); | |
68 | |
69 DartType getType(CoreTypes types) => const DynamicType(); | |
70 | |
71 List<ConstantValue> getDependencies() => const <ConstantValue>[]; | |
72 | |
73 accept(visitor, arg) { | |
74 throw new UnsupportedError("FletchClassInstanceConstant.accept"); | |
75 } | |
76 | |
77 String unparse() => toStructuredString(); | |
78 | |
79 String toStructuredString() { | |
80 return 'FletchClassInstanceConstant($classId)'; | |
81 } | |
82 } | |
OLD | NEW |