mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:27:43 +00:00
[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:
parent
64360e9f1a
commit
d93d70a89a
21
tests/compiler/dart2js_extra/38005_test.dart
Normal file
21
tests/compiler/dart2js_extra/38005_test.dart
Normal 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>());
|
||||
}
|
Loading…
Reference in a new issue