Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is static warning to create instance (new) of the malformed type #11595

Closed
scheglov opened this issue Jun 28, 2013 · 6 comments
Closed

It is static warning to create instance (new) of the malformed type #11595

scheglov opened this issue Jun 28, 2013 · 6 comments
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@scheglov
Copy link
Contributor

language/instantiate_type_variable_negative_test

12.11 Instance Creation

Instance creation expressions invoke constructors to produce instances.
It is a static type warning if the type T in an instance creation expression
of one of the forms
new T:id(a1; : : : ; an; xn+1 : an+1; : : : ; xn+k : an+k),
new T(a1; : : : ; an; xn+1 : an+1; : : : ; xn+k : an+k),
const T:id(a1; : : : ; an; xn+1 : an+1; : : : ; xn+k : an+k),
const T(a1; : : : ; an; xn+1 : an+1; : : : ; xn+k : an+k) is malformed (15.2) or
malbounded (15.8).

@scheglov
Copy link
Contributor Author

cc @peter-ahe-google.
cc @kasperl.

@larsbak
Copy link

larsbak commented Aug 28, 2013

Removed this from the M6 milestone.
Added this to the M7 milestone.

@sgjesse
Copy link
Contributor

sgjesse commented Sep 3, 2013

The test is renamed to language/instantiate_type_variable_test and is now a multi-test.

The test tests that it is not possible to instantiate a type parameter type. The spec (0.51) says the following in the "Generics" section:

Even where type parameters are in scope there are numerous restrictions at this time:
 * A type parameter cannot be used to name a constructor in an instance creation expression.
 * A type parameter cannot be used as a superclass or superinterface.

Both the VM and dart2js generate a compile-time error in this case.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M7 milestone.
Added this to the 1.6 milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@scheglov scheglov added Type-Defect area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). labels Aug 4, 2014
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

6 participants