File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
pkg/compiler/lib/src/universe Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -989,6 +989,11 @@ class ResolutionWorldBuilderImpl extends WorldBuilderBase
989
989
return _classHierarchyBuilder.isInheritedInThisClass (
990
990
memberHoldingClass, type);
991
991
case ClassRelation .subtype:
992
+ if (memberHoldingClass == _commonElements.nullClass ||
993
+ memberHoldingClass == _commonElements.jsNullClass) {
994
+ // Members of `Null` and `JSNull` are always potential targets.
995
+ return true ;
996
+ }
992
997
return _classHierarchyBuilder.isInheritedInSubtypeOf (
993
998
memberHoldingClass, type);
994
999
}
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ // Regression test for DartPad issue 881.
6
+
7
+ void main () {
8
+ String v = null ;
9
+ print ('${v .hashCode }' );
10
+ // Makes sure that [v] is not effectively final, so that we don't infer the
11
+ // static type from the initializer.
12
+ v = '' ;
13
+ }
You can’t perform that action at this time.
0 commit comments