From dae3cacc673223775e2425b0fdaab27462897d6e Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 15 May 2020 09:33:11 -0700 Subject: [PATCH] null-annotate lib/ui/natives.dart (flutter/engine#18349) --- engine/src/flutter/lib/ui/natives.dart | 12 ++++++------ .../src/flutter/lib/web_ui/lib/src/ui/natives.dart | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/lib/ui/natives.dart b/engine/src/flutter/lib/ui/natives.dart index d394e8677b3..8c5a42602eb 100644 --- a/engine/src/flutter/lib/ui/natives.dart +++ b/engine/src/flutter/lib/ui/natives.dart @@ -17,8 +17,8 @@ void _printDebug(dynamic arg) { } class _Logger { - static void _printString(String s) native 'Logger_PrintString'; - static void _printDebugString(String s) native 'Logger_PrintDebugString'; + static void _printString(String/*?*/ s) native 'Logger_PrintString'; + static void _printDebugString(String/*?*/ s) native 'Logger_PrintDebugString'; } // If we actually run on big endian machines, we'll need to do something smarter @@ -68,7 +68,7 @@ void _setupHooks() { // ignore: unused_element /// ``` /// /// This function is only effective in debug and dynamic modes, and will throw in AOT mode. -List saveCompilationTrace() { +List/*!*/ saveCompilationTrace() { final dynamic result = _saveCompilationTrace(); if (result is Error) throw result; @@ -79,11 +79,11 @@ dynamic _saveCompilationTrace() native 'SaveCompilationTrace'; void _scheduleMicrotask(void callback()) native 'ScheduleMicrotask'; -int _getCallbackHandle(Function closure) native 'GetCallbackHandle'; -Function _getCallbackFromHandle(int handle) native 'GetCallbackFromHandle'; +int/*?*/ _getCallbackHandle(Function closure) native 'GetCallbackHandle'; +Function/*?*/ _getCallbackFromHandle(int handle) native 'GetCallbackFromHandle'; // Required for gen_snapshot to work correctly. -int _isolateId; // ignore: unused_element +int/*?*/ _isolateId; // ignore: unused_element @pragma('vm:entry-point') Function _getPrintClosure() => _print; // ignore: unused_element diff --git a/engine/src/flutter/lib/web_ui/lib/src/ui/natives.dart b/engine/src/flutter/lib/web_ui/lib/src/ui/natives.dart index eabef43129e..1cdcb68c75a 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/ui/natives.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/ui/natives.dart @@ -16,10 +16,10 @@ void _printDebug(dynamic arg) { } class _Logger { - static void _printString(String s) { + static void _printString(String/*?*/ s) { print(s); } - static void _printDebugString(String s) { + static void _printDebugString(String/*?*/ s) { html.window.console.error(s); } } @@ -40,6 +40,6 @@ class _Logger { /// ``` /// /// This function is only effective in debug and dynamic modes, and will throw in AOT mode. -List saveCompilationTrace() { +List/*!*/ saveCompilationTrace() { throw UnimplementedError(); }