#491. Null-check operator tests improved and new ones added
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart
index a4a8f90..de2f4b5 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart
@@ -8,7 +8,7 @@
  * runtime error if v is null, and otherwise evaluates to v.
  *
  * @description Check that an expression of the form e! evaluates e to a value
- * v, throws a runtime error if v is null. Test class
+ * v, throws a runtime error if v is null. Test identifier
  * @author sgrekhov@unipro.ru
  * @issue 39723
  * @issue 39724
@@ -17,9 +17,13 @@
 import "../../Utils/expect.dart";
 
 class A {
+  String s = "Show must go on";
   foo() {}
   Object? get getNull => null;
   Object? operator [](int index) => null;
+  void operator []=(int index, String val) {
+    s = val;
+  }
 }
 
 main() {
@@ -29,13 +33,11 @@
   Expect.throws(() {a![42];});
   Expect.throws(() {a!?.foo();});
   Expect.throws(() {a!?.[42];});
-  a = new A();
-  if (a != null) {
-    Expect.throws(() {
-      a.getNull!;
-    });
-    Expect.throws(() {
-      a[42]!;
-    });
+  Expect.throws(() {a!.s = "Lily was here";});
+  Expect.throws(() {a![0] = "Lily was here";});
+  A? a1 = new A();
+  if (a1 != null) {
+    Expect.throws(() {a1.getNull!;});
+    Expect.throws(() {a1[42]!;});
   }
 }
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart
index 1f490d9..dbdb91c 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart
@@ -8,31 +8,35 @@
  * runtime error if v is null, and otherwise evaluates to v.
  *
  * @description Check that an expression of the form e! evaluates e to a value
- * v, throws a runtime error if v is null. Test function type
+ * v, throws no runtime error if v is not null. Test identifier
  * @author sgrekhov@unipro.ru
  * @issue 39723
- * @issue 39724
  */
 // SharedOptions=--enable-experiment=non-nullable
-import "../../Utils/expect.dart";
 
-Object? foo(int i) => null;
-Object? bar<T>(T t) => null;
+class A {
+  String s = "Show must go on";
+  foo() {}
+  Object? get getValue => "Lily was here";
+  int? operator [](int index) => index;
+  void operator []=(int index, String val) {
+    s = val;
+  }
+}
 
 main() {
-  Function? f1 = null;
-  Expect.throws(() {f1!(42);});
-  f1 = foo;
-  if (f1 != null) {
-    Expect.throws(() {
-      f1(42)!;
-    });
-  }
-
-  Function f2 = null;
-  Expect.throws(() {f2<int>!(42);});
-  f2 = bar;
-  if (f2 != null) {
-    Expect.throws(() {f2<int>(42)!;});
+  A? a = new A();
+  a!;
+  a!.foo();                       //# 01: static type warning
+  a![42];                         //# 02: static type warning
+  a!?.foo();                      //# 03: static type warning
+  a!?.[42];                       //# 04: static type warning
+  a!.s = "Lily was here";         //# 05: static type warning
+  a!?.s = "Let it be";            //# 06: static type warning
+  a![0] = "Lily was here";        //# 07: static type warning
+  a!?.[0] = "Lily was here";      //# 08: static type warning
+  if (a != null) {
+    a.getValue!;
+    a[42]!;
   }
 }
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t03.dart b/LanguageFeatures/nnbd/null_check_operator_A01_t03.dart
deleted file mode 100644
index d615f88..0000000
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t03.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
- * for details. All rights reserved. Use of this source code is governed by a
- * BSD-style license that can be found in the LICENSE file.
- */
-/**
- * @assertion An expression of the form e! evaluates e to a value v, throws a
- * runtime error if v is null, and otherwise evaluates to v.
- *
- * @description Check that an expression of the form e! evaluates e to a value
- * v, throws no runtime error if v is not null. Test function type
- * @author sgrekhov@unipro.ru
- * @issue 39723
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-class A {
-  foo() {}
-  Object? get getValue => "Lily was here";
-  int? operator [](int index) => index;
-}
-
-main() {
-  A? a = new A();
-  a!;
-  a!.foo();
-  a![42];
-  a!?.foo();
-  a!?.[42];
-  if (a != null) {
-    a.getValue!;
-    a[42]!;
-  }
-}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A02_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A02_t01.dart
new file mode 100644
index 0000000..311376a
--- /dev/null
+++ b/LanguageFeatures/nnbd/null_check_operator_A02_t01.dart
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @assertion An expression of the form e! evaluates e to a value v, throws a
+ * runtime error if v is null, and otherwise evaluates to v.
+ *
+ * @description Check that an expression of the form e! evaluates e to a value
+ * v, throws a runtime error if v is null. Test function type
+ * @author sgrekhov@unipro.ru
+ * @issue 39723
+ * @issue 39724
+ * @issue 39758
+ */
+// SharedOptions=--enable-experiment=non-nullable
+import "../../Utils/expect.dart";
+
+Object? foo(int i) => null;
+Object? bar<T>(T t) => null;
+
+main() {
+  Function? f1 = null;
+  Expect.throws(() {f1!(42);});
+  Function? f2 = foo;
+  if (f2 != null) {
+    Expect.throws(() {
+      f2(42)!;
+    });
+  }
+
+  Function? f3 = null;
+  Expect.throws(() {f3<int>!(42);});
+  Function f4 = bar;
+  if (f4 != null) {
+    Expect.throws(() {f4<int>(42)!;});
+  }
+}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart b/LanguageFeatures/nnbd/null_check_operator_A02_t02.dart
similarity index 97%
rename from LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
rename to LanguageFeatures/nnbd/null_check_operator_A02_t02.dart
index 32dc24e..7286496 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A02_t02.dart
@@ -11,6 +11,7 @@
  * v, throws no runtime error if v is not null. Test function type
  * @author sgrekhov@unipro.ru
  * @issue 39723
+ * @issue 39758
  */
 // SharedOptions=--enable-experiment=non-nullable
 
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t05.dart b/LanguageFeatures/nnbd/null_check_operator_A03_t01.dart
similarity index 75%
rename from LanguageFeatures/nnbd/null_check_operator_A01_t05.dart
rename to LanguageFeatures/nnbd/null_check_operator_A03_t01.dart
index 9ec3dcd..5ba11ee 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t05.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A03_t01.dart
@@ -16,9 +16,13 @@
 // SharedOptions=--enable-experiment=non-nullable
 
 class A {
+  String s = "Show must go on";
   foo() {}
   Object? get getValue => "Lily was here";
   int? operator [](int index) => index;
+  void operator []=(int index, String val) {
+    s = val;
+  }
 
   test() {
     this!;          //# 01: static type warning
@@ -26,6 +30,10 @@
     this![42];      //# 03: static type warning
     this!?.foo();   //# 04: static type warning
     this!?.[42];    //# 05: static type warning
+    this!.s = "Lily was here";    //# 06: static type warning
+    this!?.s = "Lily was here";   //# 07: static type warning
+    this![0] = "Lily was here";   //# 08: static type warning
+    this!?.[0] = "Lily was here"; //# 09: static type warning
     this.getValue!;
     this[42]!;
   }
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t06.dart b/LanguageFeatures/nnbd/null_check_operator_A03_t02.dart
similarity index 100%
rename from LanguageFeatures/nnbd/null_check_operator_A01_t06.dart
rename to LanguageFeatures/nnbd/null_check_operator_A03_t02.dart
diff --git a/LanguageFeatures/nnbd/null_check_operator_A03_t03.dart b/LanguageFeatures/nnbd/null_check_operator_A03_t03.dart
new file mode 100644
index 0000000..aa327b8
--- /dev/null
+++ b/LanguageFeatures/nnbd/null_check_operator_A03_t03.dart
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @assertion An expression of the form e! evaluates e to a value v, throws a
+ * runtime error if v is null, and otherwise evaluates to v.
+ *
+ * @description Check that an expression of the form e! evaluates e to a value
+ * v, throws no runtime error if v is not null. Test 'this!()' and 'this()!'
+ * @author sgrekhov@unipro.ru
+ * @issue 39723
+ * @issue 39598
+ */
+// SharedOptions=--enable-experiment=non-nullable,extension-methods
+import "../../Utils/expect.dart";
+
+class C {
+  test() {
+    Expect.equals("Lily was here: 42", this!(42));  //# 01: static type warning
+    Expect.equals("Lily was here: 42", this(42)!);  //# 02: static type warning
+  }
+  String call(int v) => "Lily was here: $v";
+}
+
+main() {
+  C c = new C();
+  c.test();
+}
\ No newline at end of file
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t07.dart b/LanguageFeatures/nnbd/null_check_operator_A04_t01.dart
similarity index 75%
rename from LanguageFeatures/nnbd/null_check_operator_A01_t07.dart
rename to LanguageFeatures/nnbd/null_check_operator_A04_t01.dart
index d794d09..7a2e559 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t07.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A04_t01.dart
@@ -16,9 +16,13 @@
 // SharedOptions=--enable-experiment=non-nullable
 
 class A {
+  String s = "Show must go on";
   foo() {}
   Object? get getValue => "Lily was here";
   int? operator [](int index) => index;
+  void operator []=(int index, String val) {
+    s = val;
+  }
 }
 
 class C extends A {
@@ -28,6 +32,10 @@
     super![42];      //# 03: static type warning
     super!?.foo();   //# 04: static type warning
     super!?.[42];    //# 05: static type warning
+    super!.s = "Lily was here";    //# 06: static type warning
+    super!?.s = "Lily was here";   //# 07: static type warning
+    super![0] = "Lily was here";   //# 08: static type warning
+    super!?.[0] = "Lily was here"; //# 09: static type warning
     super.getValue!;
     super[42]!;
   }
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart b/LanguageFeatures/nnbd/null_check_operator_A05_t01.dart
similarity index 66%
copy from LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
copy to LanguageFeatures/nnbd/null_check_operator_A05_t01.dart
index 32dc24e..37c57d8 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A05_t01.dart
@@ -8,25 +8,15 @@
  * runtime error if v is null, and otherwise evaluates to v.
  *
  * @description Check that an expression of the form e! evaluates e to a value
- * v, throws no runtime error if v is not null. Test function type
+ * v, throws no runtime error if v is not null. Test 42
  * @author sgrekhov@unipro.ru
  * @issue 39723
  */
 // SharedOptions=--enable-experiment=non-nullable
 
-Object? foo(int i) => "Lily was here";
-Object? bar<T>(T t) => 42;
-
 main() {
-  Function? f1 = foo;
-  f1!(42);
-  if (f1 != null) {
-      f1(42)!;
-  }
-
-  Function f2 = bar;
-  f2<int>!(42);
-  if (f2 != null) {
-    f2<int>(42)!;
-  }
+  42!;            //# 01: static type warning
+  42!.abs();      //# 02: static type warning
+  42!?.abs();     //# 03: static type warning
+  42.abs()!;      //# 04: static type warning
 }
diff --git a/LanguageFeatures/nnbd/null_check_operator_A05_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A05_t02.dart
new file mode 100644
index 0000000..9d6d2fc
--- /dev/null
+++ b/LanguageFeatures/nnbd/null_check_operator_A05_t02.dart
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @assertion An expression of the form e! evaluates e to a value v, throws a
+ * runtime error if v is null, and otherwise evaluates to v.
+ *
+ * @description Check that an expression of the form e! evaluates e to a value
+ * v, throws no runtime error if v is not null. Test 42
+ * @author sgrekhov@unipro.ru
+ * @issue 39723
+ */
+// SharedOptions=--enable-experiment=non-nullable,extension-methods
+import "../../Utils/expect.dart";
+
+extension on int {
+  String call(int i) => "Lily was here $i times";
+  Object? operator [](int index) => index;
+  void set s(int value) {}
+  void operator []=(int index, int val) {}
+}
+
+main() {
+  Expect.equals("Lily was here 2 times", 42!(2));   //# 01: static type warning
+  Expect.equals(24, 42![24]);                       //# 02: static type warning
+  42![24] = 24;                                     //# 03: static type warning
+  42!.s = 24;                                       //# 04: static type warning
+}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart b/LanguageFeatures/nnbd/null_check_operator_A05_t03.dart
similarity index 60%
copy from LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
copy to LanguageFeatures/nnbd/null_check_operator_A05_t03.dart
index 32dc24e..873c743 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A05_t03.dart
@@ -8,25 +8,19 @@
  * runtime error if v is null, and otherwise evaluates to v.
  *
  * @description Check that an expression of the form e! evaluates e to a value
- * v, throws no runtime error if v is not null. Test function type
+ * v, throws no runtime error if v is not null. Test 42
  * @author sgrekhov@unipro.ru
  * @issue 39723
  */
-// SharedOptions=--enable-experiment=non-nullable
+// SharedOptions=--enable-experiment=non-nullable,extension-methods
+import "../../Utils/expect.dart";
 
-Object? foo(int i) => "Lily was here";
-Object? bar<T>(T t) => 42;
+extension on int {
+  Object? call(int i) => null;
+  Object? operator [](int index) => null;
+}
 
 main() {
-  Function? f1 = foo;
-  f1!(42);
-  if (f1 != null) {
-      f1(42)!;
-  }
-
-  Function f2 = bar;
-  f2<int>!(42);
-  if (f2 != null) {
-    f2<int>(42)!;
-  }
+  Expect.throws(() {42(2)!;});
+  Expect.throws(() {42[24]!;});
 }
diff --git a/LanguageFeatures/nnbd/null_check_operator_A06_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A06_t01.dart
new file mode 100644
index 0000000..4448061
--- /dev/null
+++ b/LanguageFeatures/nnbd/null_check_operator_A06_t01.dart
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @assertion An expression of the form e! evaluates e to a value v, throws a
+ * runtime error if v is null, and otherwise evaluates to v.
+ *
+ * @description Check that an expression of the form e! evaluates e to a value
+ * v, throws a runtime error if v is null. Test constructor
+ * @author sgrekhov@unipro.ru
+ * @issue 39723
+ * @issue 39724
+ */
+// SharedOptions=--enable-experiment=non-nullable
+import "../../Utils/expect.dart";
+
+class A {
+  String s = "Show must go on";
+  foo() {}
+  Object? get getValue => "Lily was here";
+  Object? get getNull => null;
+  int? operator [](int? index) => index;
+  void operator []=(int index, String val) {
+    s = val;
+  }
+}
+
+main() {
+  new A()!;
+  new A()!.foo();
+  new A()![42];
+  new A()!?.foo();
+  new A()!?.[42];
+  new A().getValue!;
+  new A()[42]!;
+  new A()!.s = "Lily was here";
+  new A()!?.s = "Lily was here";
+  new A()![0] = "Lily was here";
+  new A()!?.[0] = "Lily was here";
+  Expect.throws(() {new A().getNull!;});
+  Expect.throws(() {new A()[null]!;});
+}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart
new file mode 100644
index 0000000..fc80de5
--- /dev/null
+++ b/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @assertion An expression of the form e! evaluates e to a value v, throws a
+ * runtime error if v is null, and otherwise evaluates to v.
+ *
+ * @description Check that an expression of the form e! evaluates e to a value
+ * v, throws a runtime error if v is null. Test generic class with named
+ * constructor
+ * @author sgrekhov@unipro.ru
+ * @issue 39723
+ * @issue 39724
+ */
+// SharedOptions=--enable-experiment=non-nullable
+import "../../Utils/expect.dart";
+
+class A<T> {
+  String s = "Show must go on";
+  foo() {}
+  Object? get getValue => "Lily was here";
+  Object? get getNull => null;
+  int? operator [](int? index) => index;
+  void operator []=(int index, String val) {
+    s = val;
+  }
+
+  A.named(T? t) {
+  }
+}
+
+main() {
+  new A<String>.named("Gaudeamus igitur")!;
+  new A<String>.named("Gaudeamus igitur")!.foo();
+  new A<String>.named("Gaudeamus igitur")![42];
+  new A<String>.named("Gaudeamus igitur")!?.foo();
+  new A<String>.named("Gaudeamus igitur")!?.[42];
+  new A<String>.named("Gaudeamus igitur").getValue!;
+  new A<String>.named("Gaudeamus igitur")[42]!;
+  new A<String>.named("Gaudeamus igitur")!.s = "Lily was here";
+  new A<String>.named("Gaudeamus igitur")!?.s = "Lily was here";
+  new A<String>.named("Gaudeamus igitur")![0] = "Lily was here";
+  new A<String>.named("Gaudeamus igitur")!?.[0] = "Lily was here";
+  Expect.throws(() {new A<String>.named("Gaudeamus igitur").getNull!;});
+  Expect.throws(() {new A<String>.named("Gaudeamus igitur")[null]!;});
+}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart b/LanguageFeatures/nnbd/null_check_operator_A07_t01.dart
similarity index 66%
copy from LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
copy to LanguageFeatures/nnbd/null_check_operator_A07_t01.dart
index 32dc24e..79067cc 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A07_t01.dart
@@ -8,25 +8,15 @@
  * runtime error if v is null, and otherwise evaluates to v.
  *
  * @description Check that an expression of the form e! evaluates e to a value
- * v, throws no runtime error if v is not null. Test function type
+ * v, throws no runtime error if v is not null. Test (true)
  * @author sgrekhov@unipro.ru
  * @issue 39723
  */
 // SharedOptions=--enable-experiment=non-nullable
 
-Object? foo(int i) => "Lily was here";
-Object? bar<T>(T t) => 42;
-
 main() {
-  Function? f1 = foo;
-  f1!(42);
-  if (f1 != null) {
-      f1(42)!;
-  }
-
-  Function f2 = bar;
-  f2<int>!(42);
-  if (f2 != null) {
-    f2<int>(42)!;
-  }
+  true!;                //# 01: static type warning
+  true!.toString();     //# 02: static type warning
+  true!?.toString();    //# 03: static type warning
+  true.toString()!;     //# 04: static type warning
 }
diff --git a/LanguageFeatures/nnbd/null_check_operator_A07_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A07_t02.dart
new file mode 100644
index 0000000..91ab937
--- /dev/null
+++ b/LanguageFeatures/nnbd/null_check_operator_A07_t02.dart
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @assertion An expression of the form e! evaluates e to a value v, throws a
+ * runtime error if v is null, and otherwise evaluates to v.
+ *
+ * @description Check that an expression of the form e! evaluates e to a value
+ * v, throws no runtime error if v is not null. Test (true)
+ * @author sgrekhov@unipro.ru
+ * @issue 39723
+ */
+// SharedOptions=--enable-experiment=non-nullable,extension-methods
+import "../../Utils/expect.dart";
+
+extension on bool {
+  String call(int i) => "Lily was here $i times";
+  Object? operator [](int index) => index;
+  void set s(int value) {}
+  void operator []=(int index, int val) {}
+}
+
+main() {
+  Expect.equals("Lily was here 2 times", true!(2));  //# 01: static type warning
+  Expect.equals(24, true![24]);                      //# 02: static type warning
+  true![24] = 24;                                    //# 03: static type warning
+  true!.s = 24;                                      //# 04: static type warning
+}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart b/LanguageFeatures/nnbd/null_check_operator_A07_t03.dart
similarity index 60%
copy from LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
copy to LanguageFeatures/nnbd/null_check_operator_A07_t03.dart
index 32dc24e..5df6786 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A01_t04.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A07_t03.dart
@@ -8,25 +8,19 @@
  * runtime error if v is null, and otherwise evaluates to v.
  *
  * @description Check that an expression of the form e! evaluates e to a value
- * v, throws no runtime error if v is not null. Test function type
+ * v, throws no runtime error if v is not null. Test (true)
  * @author sgrekhov@unipro.ru
  * @issue 39723
  */
-// SharedOptions=--enable-experiment=non-nullable
+// SharedOptions=--enable-experiment=non-nullable,extension-methods
+import "../../Utils/expect.dart";
 
-Object? foo(int i) => "Lily was here";
-Object? bar<T>(T t) => 42;
+extension on bool {
+  Object? call(int i) => null;
+  Object? operator [](int index) => null;
+}
 
 main() {
-  Function? f1 = foo;
-  f1!(42);
-  if (f1 != null) {
-      f1(42)!;
-  }
-
-  Function f2 = bar;
-  f2<int>!(42);
-  if (f2 != null) {
-    f2<int>(42)!;
-  }
+  Expect.throws(() {true(2)!;});
+  Expect.throws(() {true[24]!;});
 }