-
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.
- Loading branch information
Showing
7 changed files
with
71 additions
and
4 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
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
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
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
27 changes: 27 additions & 0 deletions
27
pkg/vm/testcases/transformations/type_flow/transformer/regress_47878.dart
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,27 @@ | ||
// Copyright (c) 2021, 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. | ||
|
||
// Regression test for https://github.com/dart-lang/sdk/issues/47878 | ||
|
||
abstract class Disposable {} | ||
|
||
class A {} | ||
|
||
class Data<T> { | ||
T? value; | ||
} | ||
|
||
class DataStream<T> { | ||
DataStream({newValue, Data<T>? stream}) { | ||
var lastValue = stream!.value; | ||
|
||
if (lastValue != null && | ||
lastValue is Disposable && | ||
lastValue != newValue) {} | ||
} | ||
} | ||
|
||
void main() { | ||
DataStream<A>(); | ||
} |
26 changes: 26 additions & 0 deletions
26
pkg/vm/testcases/transformations/type_flow/transformer/regress_47878.dart.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,26 @@ | ||
library #lib /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
abstract class Disposable extends core::Object { | ||
} | ||
abstract class A extends core::Object { | ||
} | ||
abstract class Data<T extends core::Object? = dynamic> extends core::Object { | ||
} | ||
class DataStream<T extends core::Object? = dynamic> extends core::Object { | ||
constructor •() → self::DataStream<self::DataStream::T%> | ||
: super core::Object::•() { | ||
self::DataStream::T? lastValue = block { | ||
#C1!; | ||
} =>throw "Attempt to execute code removed by Dart AOT compiler (TFA)"; | ||
if(!(throw "Attempt to execute code removed by Dart AOT compiler (TFA)") && false && !([@vm.inferred-type.metadata=dart.core::bool (skip check) (receiver not int)] lastValue{self::DataStream::T & self::Disposable /* '!' & '!' = '!' */} =={core::Object::==}{(core::Object) → core::bool} #C1)) { | ||
} | ||
} | ||
} | ||
static method main() → void { | ||
new self::DataStream::•<self::A>(); | ||
} | ||
constants { | ||
#C1 = null | ||
} |
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 |
---|---|---|
|
@@ -26,6 +26,6 @@ | |
CHANNEL stable | ||
MAJOR 2 | ||
MINOR 15 | ||
PATCH 0 | ||
PATCH 1 | ||
PRERELEASE 0 | ||
PRERELEASE_PATCH 0 |