From eb09095bd4054d5f72ac1661db4e321c708bfbda Mon Sep 17 00:00:00 2001 From: Hixie Date: Thu, 18 Jun 2015 16:11:29 -0700 Subject: [PATCH] Zero warnings from the analyzer! Ok, not really zero. Actually 72 if you include warnings from non-sky packages and if you include bogus warnings that can be filtered out. If you pipe the analyzer's output through the following perl script, though, you get zero warnings on the stock app with this patch: while (defined($_ = )) { s|out/android_Debug/gen/dart-pkg/sky/|sky/sdk/|gos; next if m|/dart-pkg/|os; # other packages next if m|^\[warning] Missing concrete implementation of 'RenderObject.toString'|os; # https://github.com/dart-lang/sdk/issues/23606 print; } R=abarth@chromium.org Review URL: https://codereview.chromium.org/1182323009. --- sdk/lib/rendering/box.dart | 2 +- sdk/lib/widgets/ink_well.dart | 17 +++++++++-------- sdk/lib/widgets/widget.dart | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/sdk/lib/rendering/box.dart b/sdk/lib/rendering/box.dart index bf800c38b5e..ef9ee9363fd 100644 --- a/sdk/lib/rendering/box.dart +++ b/sdk/lib/rendering/box.dart @@ -893,7 +893,7 @@ class RenderTransform extends RenderProxyBox { void hitTestChildren(HitTestResult result, { Point position }) { Matrix4 inverse = new Matrix4.zero(); - double det = inverse.copyInverse(_transform); + /* double det = */ inverse.copyInverse(_transform); // TODO(abarth): Check the determinant for degeneracy. Vector3 position3 = new Vector3(position.x, position.y, 0.0); diff --git a/sdk/lib/widgets/ink_well.dart b/sdk/lib/widgets/ink_well.dart index 95a78daeb00..e40c3701468 100644 --- a/sdk/lib/widgets/ink_well.dart +++ b/sdk/lib/widgets/ink_well.dart @@ -65,14 +65,15 @@ class RenderInkWell extends RenderProxyBox { final List _splashes = new List(); void handleEvent(sky.Event event, BoxHitTestEntry entry) { - switch (event.type) { - case 'gesturetapdown': - // TODO(abarth): We should position the splash at the location of the tap. - _startSplash(event.primaryPointer, entry.localPosition); - break; - case 'gesturetap': - _confirmSplash(event.primaryPointer); - break; + if (event is sky.GestureEvent) { + switch (event.type) { + case 'gesturetapdown': + _startSplash(event.primaryPointer, entry.localPosition); + break; + case 'gesturetap': + _confirmSplash(event.primaryPointer); + break; + } } } diff --git a/sdk/lib/widgets/widget.dart b/sdk/lib/widgets/widget.dart index 0773cd5ec13..9b4001eff92 100644 --- a/sdk/lib/widgets/widget.dart +++ b/sdk/lib/widgets/widget.dart @@ -109,11 +109,11 @@ abstract class Widget { // Returns the child which should be retained as the child of this node. Widget syncChild(Widget node, Widget oldNode, dynamic slot) { - assert(oldNode is! Component || !oldNode._disqualifiedFromEverAppearingAgain); + assert(oldNode is! Component || (oldNode is Component && !oldNode._disqualifiedFromEverAppearingAgain)); // TODO(ianh): Simplify this once the analyzer is cleverer if (node == oldNode) { assert(node == null || node.mounted); - assert(node is! RenderObjectWrapper || node._ancestor != null); + assert(node is! RenderObjectWrapper || (node is RenderObjectWrapper && node._ancestor != null)); // TODO(ianh): Simplify this once the analyzer is cleverer return node; // Nothing to do. Subtrees must be identical. } @@ -495,7 +495,7 @@ abstract class RenderObjectWrapper extends Widget { void insertChildRoot(RenderObjectWrapper child, dynamic slot); void detachChildRoot(RenderObjectWrapper child); - void _sync(Widget old, dynamic slot) { + void _sync(RenderObjectWrapper old, dynamic slot) { // TODO(abarth): We should split RenderObjectWrapper into two pieces so that // RenderViewObject doesn't need to inherit all this code it // doesn't need.