From 57dc071f79faaabf15187839b0360557c1e932b9 Mon Sep 17 00:00:00 2001 From: gmackall <34871572+gmackall@users.noreply.github.com> Date: Thu, 5 Jan 2023 16:10:07 -0800 Subject: [PATCH] Adding 'is' to list of kotlin reserved keywords (#116299) Co-authored-by: Gray Mackall --- packages/flutter_tools/lib/src/template.dart | 2 +- .../test/general.shard/android/template_test.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/template.dart b/packages/flutter_tools/lib/src/template.dart index 60fc5e7828122..9089d13796cec 100644 --- a/packages/flutter_tools/lib/src/template.dart +++ b/packages/flutter_tools/lib/src/template.dart @@ -17,7 +17,7 @@ import 'dart/package_map.dart'; /// They are escaped in Kotlin files. /// /// https://kotlinlang.org/docs/keyword-reference.html -const List kReservedKotlinKeywords = ['when', 'in']; +const List kReservedKotlinKeywords = ['when', 'in', 'is']; /// Expands templates in a directory to a destination. All files that must /// undergo template expansion should end with the '.tmpl' extension. All files diff --git a/packages/flutter_tools/test/general.shard/android/template_test.dart b/packages/flutter_tools/test/general.shard/android/template_test.dart index 4b6e031fb9d4b..5a915e5931225 100644 --- a/packages/flutter_tools/test/general.shard/android/template_test.dart +++ b/packages/flutter_tools/test/general.shard/android/template_test.dart @@ -36,12 +36,12 @@ void main() { ); final Map context = { - 'androidIdentifier': 'in.when.there', + 'androidIdentifier': 'is.in.when.there', }; template.render(destination, context); final File destinationFile = destination.childFile(outputClass); - expect(destinationFile.readAsStringSync(), equals('package `in`.`when`.there;')); + expect(destinationFile.readAsStringSync(), equals('package `is`.`in`.`when`.there;')); }); }