Skip to content

Commit

Permalink
[fasta] Add a test case for issue #34899
Browse files Browse the repository at this point in the history
Bug: http://dartbug.com/34899
Change-Id: Ia7d9c0c9be711e3f9f0e07552222f1b28a140ec1
Reviewed-on: https://dart-review.googlesource.com/c/81240
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
  • Loading branch information
Dmitry Stefantsov authored and commit-bot@chromium.org committed Oct 23, 2018
1 parent 03765ed commit c04215d
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pkg/front_end/testcases/issue34899.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2018, 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.

class Foo<T> {
final Future<dynamic> Function() quux;
T t;

Foo(this.quux, this.t);

Future<T> call() => quux().then<T>((_) => t);
}

class Bar {
Foo<Baz> qux;

Future<void> quuz() =>
qux().then((baz) => corge(baz)).then((grault) => garply(grault));

Grault corge(Baz baz) => null;

void garply(Grault grault) {}
}

class Baz {}

class Grault {}

main() {}
36 changes: 36 additions & 0 deletions pkg/front_end/testcases/issue34899.dart.direct.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
library;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;

class Foo<T extends core::Object = dynamic> extends core::Object {
final field () → asy::Future<dynamic> quux;
field self::Foo::T t;
constructor •(() → asy::Future<dynamic> quux, self::Foo::T t) → self::Foo<self::Foo::T>
: self::Foo::quux = quux, self::Foo::t = t, super core::Object::•()
;
method call() → asy::Future<self::Foo::T>
return this.quux().then<self::Foo::T>((dynamic _) → dynamic => this.{self::Foo::t});
}
class Bar extends core::Object {
field self::Foo<self::Baz> qux = null;
synthetic constructor •() → self::Bar
: super core::Object::•()
;
method quuz() → asy::Future<void>
return this.qux().then((dynamic baz) → dynamic => this.{self::Bar::corge}(baz)).then((dynamic grault) → dynamic => this.{self::Bar::garply}(grault));
method corge(self::Baz baz) → self::Grault
return null;
method garply(self::Grault grault) → void {}
}
class Baz extends core::Object {
synthetic constructor •() → self::Baz
: super core::Object::•()
;
}
class Grault extends core::Object {
synthetic constructor •() → self::Grault
: super core::Object::•()
;
}
static method main() → dynamic {}
36 changes: 36 additions & 0 deletions pkg/front_end/testcases/issue34899.dart.direct.transformed.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
library;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;

class Foo<T extends core::Object = dynamic> extends core::Object {
final field () → asy::Future<dynamic> quux;
field self::Foo::T t;
constructor •(() → asy::Future<dynamic> quux, self::Foo::T t) → self::Foo<self::Foo::T>
: self::Foo::quux = quux, self::Foo::t = t, super core::Object::•()
;
method call() → asy::Future<self::Foo::T>
return this.quux().then<self::Foo::T>((dynamic _) → dynamic => this.{self::Foo::t});
}
class Bar extends core::Object {
field self::Foo<self::Baz> qux = null;
synthetic constructor •() → self::Bar
: super core::Object::•()
;
method quuz() → asy::Future<void>
return this.qux().then((dynamic baz) → dynamic => this.{self::Bar::corge}(baz)).then((dynamic grault) → dynamic => this.{self::Bar::garply}(grault));
method corge(self::Baz baz) → self::Grault
return null;
method garply(self::Grault grault) → void {}
}
class Baz extends core::Object {
synthetic constructor •() → self::Baz
: super core::Object::•()
;
}
class Grault extends core::Object {
synthetic constructor •() → self::Grault
: super core::Object::•()
;
}
static method main() → dynamic {}
34 changes: 34 additions & 0 deletions pkg/front_end/testcases/issue34899.dart.outline.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
library;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;

class Foo<T extends core::Object = dynamic> extends core::Object {
final field () → asy::Future<dynamic> quux;
field self::Foo::T t;
constructor •(() → asy::Future<dynamic> quux, self::Foo::T t) → self::Foo<self::Foo::T>
;
method call() → asy::Future<self::Foo::T>
;
}
class Bar extends core::Object {
field self::Foo<self::Baz> qux;
synthetic constructor •() → self::Bar
;
method quuz() → asy::Future<void>
;
method corge(self::Baz baz) → self::Grault
;
method garply(self::Grault grault) → void
;
}
class Baz extends core::Object {
synthetic constructor •() → self::Baz
;
}
class Grault extends core::Object {
synthetic constructor •() → self::Grault
;
}
static method main() → dynamic
;
1 change: 1 addition & 0 deletions pkg/front_end/testcases/strong.status
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ instantiate_to_bound/body_typedef_super_bounded_type: Fail # Issue 33444
instantiate_to_bound/typedef_super_bounded_type: Fail # Issue 33444
invalid_type: TypeCheckError
invocations: Fail
issue34899: Crash
literals: Fail
map: Fail
micro: Fail
Expand Down

0 comments on commit c04215d

Please sign in to comment.