Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: pkg/kernel/testcases/reify/generic_methods_shadowing_test.dart

Issue 2756693002: Add generic-methods 'golden' tests for 'reify' transformation (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017, 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 // Test that type parameters in generic methods can be shadowed.
6
7 library generic_methods_shadowing_test;
8
9 import "test_base.dart";
10
11 class X {}
12
13 class Y {}
14
15 bool foo<T, S>(T t, S s) {
16
17 // The type parameter T of bar shadows the type parameter T of foo.
18 bool bar<T>(T t) {
19 return t is T && t is S;
20 }
21
22 return bar<S>(s);
23 }
24
25 main() {
26 expectTrue(foo<X, Y>(new X(), new Y()));
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698