You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scheglov opened this issue
Nov 29, 2012
· 6 comments
Labels
area-testCross-cutting test issues (use area- labels for specific failures; not used for package:test).P2A bug or feature request we're likely to work ontype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
class Foo<T> {
Foo() {}
T make() { return new T(); }
}
Spec about type variables:
The type parameters of a generic declaration G are in scope in the bounds of all of the type parameters of G. The type parameters of a generic class declaration G are also in scope in the extends and implements clauses of G (if these exist) and in the body of G. However, a type parameter is considered to be a malformed type when referenced by a static member.
Spec about "new":
Let e be a new expression of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) or the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k). It is a static warning if T is not a class accessible in the current scope, optionally followed by type arguments.
So, these tests are not negative, they don't produce compile-time error.
The text was updated successfully, but these errors were encountered:
kevmoo
added
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
and removed
triaged
labels
Feb 29, 2016
area-testCross-cutting test issues (use area- labels for specific failures; not used for package:test).P2A bug or feature request we're likely to work ontype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
language/instantiate_type_variable_negative_test
language/type_variable_static_context_negative_test
class Foo<T> {
Foo() {}
T make() { return new T(); }
}
Spec about type variables:
The type parameters of a generic declaration G are in scope in the bounds of all of the type parameters of G. The type parameters of a generic class declaration G are also in scope in the extends and implements clauses of G (if these exist) and in the body of G. However, a type parameter is considered to be a malformed type when referenced by a static member.
Spec about "new":
Let e be a new expression of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) or the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k). It is a static warning if T is not a class accessible in the current scope, optionally followed by type arguments.
So, these tests are not negative, they don't produce compile-time error.
The text was updated successfully, but these errors were encountered: