-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cfe] Deem all intersection types syntactically not nullable
Closes #44362. Bug: #44362 Change-Id: Id54de1848e6af1108956476e241bab5c0ed96a4b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177124 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
- Loading branch information
Dmitry Stefantsov
authored and
commit-bot@chromium.org
committed
Dec 29, 2020
1 parent
13b1af4
commit 0642e7a
Showing
9 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) 2020, 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. | ||
|
||
foo<X>(X? x) { | ||
if (x is int) { | ||
bar(x); | ||
} | ||
} | ||
|
||
bar<Y>(dynamic y) {} | ||
|
||
main() {} |
10 changes: 10 additions & 0 deletions
10
pkg/front_end/testcases/nnbd/issue44362.dart.outline.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static method foo<X extends core::Object? = dynamic>(self::foo::X? x) → dynamic | ||
; | ||
static method bar<Y extends core::Object? = dynamic>(dynamic y) → dynamic | ||
; | ||
static method main() → dynamic | ||
; |
11 changes: 11 additions & 0 deletions
11
pkg/front_end/testcases/nnbd/issue44362.dart.strong.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static method foo<X extends core::Object? = dynamic>(self::foo::X? x) → dynamic { | ||
if(x is{ForNonNullableByDefault} core::int) { | ||
self::bar<dynamic>(x{self::foo::X? & core::int /* '?' & '!' = '!' */}); | ||
} | ||
} | ||
static method bar<Y extends core::Object? = dynamic>(dynamic y) → dynamic {} | ||
static method main() → dynamic {} |
11 changes: 11 additions & 0 deletions
11
pkg/front_end/testcases/nnbd/issue44362.dart.strong.transformed.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static method foo<X extends core::Object? = dynamic>(self::foo::X? x) → dynamic { | ||
if(x is{ForNonNullableByDefault} core::int) { | ||
self::bar<dynamic>(x{self::foo::X? & core::int /* '?' & '!' = '!' */}); | ||
} | ||
} | ||
static method bar<Y extends core::Object? = dynamic>(dynamic y) → dynamic {} | ||
static method main() → dynamic {} |
3 changes: 3 additions & 0 deletions
3
pkg/front_end/testcases/nnbd/issue44362.dart.textual_outline.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
foo<X>(X? x) {} | ||
bar<Y>(dynamic y) {} | ||
main() {} |
3 changes: 3 additions & 0 deletions
3
pkg/front_end/testcases/nnbd/issue44362.dart.textual_outline_modelled.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bar<Y>(dynamic y) {} | ||
foo<X>(X? x) {} | ||
main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static method foo<X extends core::Object? = dynamic>(self::foo::X? x) → dynamic { | ||
if(x is{ForNonNullableByDefault} core::int) { | ||
self::bar<dynamic>(x{self::foo::X? & core::int /* '?' & '!' = '!' */}); | ||
} | ||
} | ||
static method bar<Y extends core::Object? = dynamic>(dynamic y) → dynamic {} | ||
static method main() → dynamic {} |
11 changes: 11 additions & 0 deletions
11
pkg/front_end/testcases/nnbd/issue44362.dart.weak.transformed.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static method foo<X extends core::Object? = dynamic>(self::foo::X? x) → dynamic { | ||
if(x is{ForNonNullableByDefault} core::int) { | ||
self::bar<dynamic>(x{self::foo::X? & core::int /* '?' & '!' = '!' */}); | ||
} | ||
} | ||
static method bar<Y extends core::Object? = dynamic>(dynamic y) → dynamic {} | ||
static method main() → dynamic {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters