-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fasta] Add a test case for issue #34899
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
Showing
5 changed files
with
136 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,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() {} |
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,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
36
pkg/front_end/testcases/issue34899.dart.direct.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,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 {} |
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,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 | ||
; |
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