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

Side by Side Diff: test/dart_codegen/expect/math/rectangle.dart

Issue 959003003: Typecheck constructor initializers properly (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 part of dart.math; 1 part of dart.math;
2 abstract class _RectangleBase<T extends num> {const _RectangleBase(); 2 abstract class _RectangleBase<T extends num> {const _RectangleBase();
3 T get left; 3 T get left;
4 T get top; 4 T get top;
5 T get width; 5 T get width;
6 T get height; 6 T get height;
7 T get right => ((__x1) => DDC$RT.cast(__x1, num, T, "CastGeneral", """line 33, column 18 of dart:math/rectangle.dart: """, __x1 is T, false))(left + width); 7 T get right => ((__x1) => DDC$RT.cast(__x1, num, T, "CastGeneral", """line 33, column 18 of dart:math/rectangle.dart: """, __x1 is T, false))(left + width);
8 T get bottom => ((__x2) => DDC$RT.cast(__x2, num, T, "CastGeneral", """line 35, column 19 of dart:math/rectangle.dart: """, __x2 is T, false))(top + height); 8 T get bottom => ((__x2) => DDC$RT.cast(__x2, num, T, "CastGeneral", """line 35, column 19 of dart:math/rectangle.dart: """, __x2 is T, false))(top + height);
9 String toString() { 9 String toString() {
10 return 'Rectangle ($left, $top) $width x $height'; 10 return 'Rectangle ($left, $top) $width x $height';
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 T width = ((__x4) => DDC$RT.cast(__x4, num, T, "CastGeneral", """line 168, colu mn 15 of dart:math/rectangle.dart: """, __x4 is T, false))(max(a.x, b.x) - left) ; 57 T width = ((__x4) => DDC$RT.cast(__x4, num, T, "CastGeneral", """line 168, colu mn 15 of dart:math/rectangle.dart: """, __x4 is T, false))(max(a.x, b.x) - left) ;
58 T top = ((__x5) => DDC$RT.cast(__x5, num, T, "CastGeneral", """line 169, column 13 of dart:math/rectangle.dart: """, __x5 is T, false))(min(a.y, b.y)); 58 T top = ((__x5) => DDC$RT.cast(__x5, num, T, "CastGeneral", """line 169, column 13 of dart:math/rectangle.dart: """, __x5 is T, false))(min(a.y, b.y));
59 T height = ((__x6) => DDC$RT.cast(__x6, num, T, "CastGeneral", """line 170, col umn 16 of dart:math/rectangle.dart: """, __x6 is T, false))(max(a.y, b.y) - top) ; 59 T height = ((__x6) => DDC$RT.cast(__x6, num, T, "CastGeneral", """line 170, col umn 16 of dart:math/rectangle.dart: """, __x6 is T, false))(max(a.y, b.y) - top) ;
60 return new Rectangle<T>(left, top, width, height); 60 return new Rectangle<T>(left, top, width, height);
61 } 61 }
62 } 62 }
63 class MutableRectangle<T extends num> extends _RectangleBase<T> implements Rect angle<T> {T left; 63 class MutableRectangle<T extends num> extends _RectangleBase<T> implements Rect angle<T> {T left;
64 T top; 64 T top;
65 T _width; 65 T _width;
66 T _height; 66 T _height;
67 MutableRectangle(this.left, this.top, T width, T height) : this._width = (width < 0) ? _clampToZero(width) : width, this._height = (height < 0) ? _clampToZero( height) : height; 67 MutableRectangle(this.left, this.top, T width, T height) : this._width = ((__x7 ) => DDC$RT.cast(__x7, dynamic, T, "CastGeneral", """line 212, column 23 of dart :math/rectangle.dart: """, __x7 is T, false))((width < 0) ? _clampToZero(width) : width), this._height = ((__x8) => DDC$RT.cast(__x8, dynamic, T, "CastGeneral", """line 213, column 24 of dart:math/rectangle.dart: """, __x8 is T, false))((he ight < 0) ? _clampToZero(height) : height);
68 factory MutableRectangle.fromPoints(Point<T> a, Point<T> b) { 68 factory MutableRectangle.fromPoints(Point<T> a, Point<T> b) {
69 T left = ((__x7) => DDC$RT.cast(__x7, num, T, "CastGeneral", """line 228, column 14 of dart:math/rectangle.dart: """, __x7 is T, false))(min(a.x, b.x)); 69 T left = ((__x9) => DDC$RT.cast(__x9, num, T, "CastGeneral", """line 228, column 14 of dart:math/rectangle.dart: """, __x9 is T, false))(min(a.x, b.x));
70 T width = ((__x8) => DDC$RT.cast(__x8, num, T, "CastGeneral", """line 229, colu mn 15 of dart:math/rectangle.dart: """, __x8 is T, false))(max(a.x, b.x) - left) ; 70 T width = ((__x10) => DDC$RT.cast(__x10, num, T, "CastGeneral", """line 229, co lumn 15 of dart:math/rectangle.dart: """, __x10 is T, false))(max(a.x, b.x) - le ft);
71 T top = ((__x9) => DDC$RT.cast(__x9, num, T, "CastGeneral", """line 230, column 13 of dart:math/rectangle.dart: """, __x9 is T, false))(min(a.y, b.y)); 71 T top = ((__x11) => DDC$RT.cast(__x11, num, T, "CastGeneral", """line 230, colu mn 13 of dart:math/rectangle.dart: """, __x11 is T, false))(min(a.y, b.y));
72 T height = ((__x10) => DDC$RT.cast(__x10, num, T, "CastGeneral", """line 231, c olumn 16 of dart:math/rectangle.dart: """, __x10 is T, false))(max(a.y, b.y) - t op); 72 T height = ((__x12) => DDC$RT.cast(__x12, num, T, "CastGeneral", """line 231, c olumn 16 of dart:math/rectangle.dart: """, __x12 is T, false))(max(a.y, b.y) - t op);
73 return new MutableRectangle<T>(left, top, width, height); 73 return new MutableRectangle<T>(left, top, width, height);
74 } 74 }
75 T get width => _width; 75 T get width => _width;
76 void set width(T width) { 76 void set width(T width) {
77 if (width < 0) width = ((__x11) => DDC$RT.cast(__x11, num, T, "CastGeneral", """ line 247, column 28 of dart:math/rectangle.dart: """, __x11 is T, false))(_clamp ToZero(width)); 77 if (width < 0) width = ((__x13) => DDC$RT.cast(__x13, num, T, "CastGeneral", """ line 247, column 28 of dart:math/rectangle.dart: """, __x13 is T, false))(_clamp ToZero(width));
78 _width = width; 78 _width = width;
79 } 79 }
80 T get height => _height; 80 T get height => _height;
81 void set height(T height) { 81 void set height(T height) {
82 if (height < 0) height = ((__x12) => DDC$RT.cast(__x12, num, T, "CastGeneral", " ""line 263, column 30 of dart:math/rectangle.dart: """, __x12 is T, false))(_cla mpToZero(height)); 82 if (height < 0) height = ((__x14) => DDC$RT.cast(__x14, num, T, "CastGeneral", " ""line 263, column 30 of dart:math/rectangle.dart: """, __x14 is T, false))(_cla mpToZero(height));
83 _height = height; 83 _height = height;
84 } 84 }
85 } 85 }
86 num _clampToZero(num value) { 86 num _clampToZero(num value) {
87 assert (value < 0); return -value * 0; 87 assert (value < 0); return -value * 0;
88 } 88 }
OLDNEW
« test/checker/checker_test.dart ('K') | « test/dart_codegen/expect/core/uri.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698