[dart2js] Add test for issue #38005.

Change-Id: Ie13483d9ad0f8eb9a1582f7d8378ae859184b654
Bug: https://github.com/dart-lang/sdk/issues/38005
Fixes: https://github.com/dart-lang/sdk/issues/38005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116365
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
This commit is contained in:
Mayank Patke 2019-09-10 22:07:42 +00:00 committed by commit-bot@chromium.org
parent 64360e9f1a
commit d93d70a89a

View file

@ -0,0 +1,21 @@
// Copyright (c) 2019, 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.
import "package:expect/expect.dart";
class A {}
int foo<T>() {
switch (T) {
case A:
return 42;
default:
return -1;
}
}
void main() {
Expect.equals(42, foo<A>());
Expect.equals(-1, foo<int>());
}