mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:51:18 +00:00
d744ef69c5
R=gbracha@google.com Review URL: https://codereview.chromium.org//24650002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28413 260f80e4-7a28-3924-810f-c04153c831b5
37 lines
846 B
Dart
37 lines
846 B
Dart
// Copyright (c) 2013, 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.
|
|
|
|
// Test that we report a compile-time error when a type parameter conflicts
|
|
// with an instance or static member with the same name.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
class G1<T> {
|
|
var T; /// 01: compile-time error
|
|
}
|
|
class G2<T> {
|
|
get T {} /// 02: compile-time error
|
|
}
|
|
class G3<T> {
|
|
T() {} /// 03: compile-time error
|
|
}
|
|
class G4<T> {
|
|
static var T; /// 04: compile-time error
|
|
}
|
|
class G5<T> {
|
|
static get T {} /// 05: compile-time error
|
|
}
|
|
class G6<T> {
|
|
static T() {} /// 06: compile-time error
|
|
}
|
|
|
|
main() {
|
|
new G1<int>();
|
|
new G2<int>();
|
|
new G3<int>();
|
|
new G4<int>();
|
|
new G5<int>();
|
|
new G6<int>();
|
|
}
|