| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:16:5: Error: Property 'length' cannot be accessed on 'String?' because it is potentially null. |
| // Try accessing using ?. instead. |
| // s.length; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:20:5: Error: Property 'bar' cannot be accessed on 'A?' because it is potentially null. |
| // - 'A' is from 'pkg/front_end/testcases/nnbd/nullable_receiver.dart'. |
| // Try accessing using ?. instead. |
| // a.bar; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:24:12: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'Function'. |
| // - 'Function' is from 'dart:core'. |
| // Function f1 = a; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:25:19: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'void Function()'. |
| // void Function() f2 = a; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:34:5: Error: Property 'hashCode' cannot be accessed on 'String?' because it is potentially null. |
| // Try accessing using ?. instead. |
| // s.hashCode; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:35:5: Error: Property 'hashCode' cannot be accessed on 'A?' because it is potentially null. |
| // - 'A' is from 'pkg/front_end/testcases/nnbd/nullable_receiver.dart'. |
| // Try accessing using ?. instead. |
| // a.hashCode; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:43:5: Error: Property 'runtimeType' cannot be accessed on 'String?' because it is potentially null. |
| // Try accessing using ?. instead. |
| // s.runtimeType; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_receiver.dart:44:5: Error: Property 'runtimeType' cannot be accessed on 'A?' because it is potentially null. |
| // - 'A' is from 'pkg/front_end/testcases/nnbd/nullable_receiver.dart'. |
| // Try accessing using ?. instead. |
| // a.runtimeType; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class A extends core::Object { |
| synthetic constructor •() → self::A |
| : super core::Object::•() |
| ; |
| method foo() → dynamic {} |
| get bar() → core::int |
| return 42; |
| set baz(core::int value) → void {} |
| method call() → void {} |
| } |
| static method error(core::String? s, self::A? a) → dynamic { |
| let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:16:5: Error: Property 'length' cannot be accessed on 'String?' because it is potentially null. |
| Try accessing using ?. instead. |
| s.length; |
| ^" in s.{core::String::length}; |
| s.{core::String::substring}(1, 1); |
| a.{self::A::foo}(); |
| let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:20:5: Error: Property 'bar' cannot be accessed on 'A?' because it is potentially null. |
| - 'A' is from 'pkg/front_end/testcases/nnbd/nullable_receiver.dart'. |
| Try accessing using ?. instead. |
| a.bar; |
| ^" in a.{self::A::bar}; |
| a.{self::A::baz} = 42; |
| a.{self::A::call}(); |
| core::Function f1 = let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:24:12: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'Function'. |
| - 'Function' is from 'dart:core'. |
| Function f1 = a; |
| ^" in (let final self::A? #t4 = a in #t4.==(null) ?{() →? void} null : #t4.{self::A::call}) as{TypeError} core::Function; |
| () → void f2 = let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:25:19: Error: A value of type 'void Function()?' can't be assigned to a variable of type 'void Function()'. |
| void Function() f2 = a; |
| ^" in (let final self::A? #t6 = a in #t6.==(null) ?{() →? void} null : #t6.{self::A::call}) as{TypeError} () → void; |
| () →? void f3 = let final self::A? #t7 = a in #t7.==(null) ?{() →? void} null : #t7.{self::A::call}; |
| } |
| static method ok(core::String? s, self::A? a, core::Invocation i) → dynamic { |
| s.{core::String::==}(s); |
| a.{core::Object::==}(a); |
| let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:34:5: Error: Property 'hashCode' cannot be accessed on 'String?' because it is potentially null. |
| Try accessing using ?. instead. |
| s.hashCode; |
| ^" in s.{core::String::hashCode}; |
| let final<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:35:5: Error: Property 'hashCode' cannot be accessed on 'A?' because it is potentially null. |
| - 'A' is from 'pkg/front_end/testcases/nnbd/nullable_receiver.dart'. |
| Try accessing using ?. instead. |
| a.hashCode; |
| ^" in a.{core::Object::hashCode}; |
| s.{core::Object::toString}(); |
| a.{core::Object::toString}(); |
| try { |
| s.{core::Object::noSuchMethod}(i); |
| } |
| on dynamic catch(final dynamic e, final core::StackTrace t) { |
| } |
| try { |
| a.{core::Object::noSuchMethod}(i); |
| } |
| on dynamic catch(final dynamic e, final core::StackTrace t) { |
| } |
| let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:43:5: Error: Property 'runtimeType' cannot be accessed on 'String?' because it is potentially null. |
| Try accessing using ?. instead. |
| s.runtimeType; |
| ^" in s.{core::Object::runtimeType}; |
| let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/nullable_receiver.dart:44:5: Error: Property 'runtimeType' cannot be accessed on 'A?' because it is potentially null. |
| - 'A' is from 'pkg/front_end/testcases/nnbd/nullable_receiver.dart'. |
| Try accessing using ?. instead. |
| a.runtimeType; |
| ^" in a.{core::Object::runtimeType}; |
| } |
| static method main() → dynamic {} |