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

VM: compile error in checked mode when a constructor's type parameter is not within declared type bound #6030

Closed
DartBot opened this issue Oct 18, 2012 · 5 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-as-intended Closed as the reported issue is expected behavior

Comments

@DartBot
Copy link

DartBot commented Oct 18, 2012

This issue was originally filed by [email protected]


looks like a duplicate of 905 or 1380

Spec (11 and 11.11.1) says it's only a static warning and a type error in checked mode, but co19 test Language/10_Expressions/11_Instance_Creation_A05_t02 fails with a compile error

class G<T extends num, S extends String> {
  const G();
}

main() {
  checkTypeError(() {
    var o = const G<double, double>();
  });
}

@dgrove
Copy link
Contributor

dgrove commented Oct 23, 2012

Added Area-VM, Triaged labels.

@iposva-google
Copy link
Contributor

Set owner to @crelier.
Added Accepted label.

@crelier
Copy link
Contributor

crelier commented Oct 23, 2012

This is not a duplicate of 905 or 1380.

The VM reports a compile-time error in checked mode, which is correct.

There is a co19 issue reported against this test, co19 issue #234.


Added AsDesigned label.

@crelier
Copy link
Contributor

crelier commented Dec 12, 2012

Reopening for investigation.

regis@belenos:~/dart1/dart$ out/DebugIA32/dart --checked /usr/local/google/home/regis/dart1/dart/tests/co19/src/Language/11_Expressions/11_Instance_Creation_A05_t02.dart
'file:///usr/local/google/home/regis/dart1/dart/tests/co19/src/Language/11_Expressions/11_Instance_Creation_A05_t02.dart': Error: line 19 pos 24: type argument 'double' does not extend bound 'String' of 'G'

class G<T extends num, S extends String> {
                       ^
'file:///usr/local/google/home/regis/dart1/dart/tests/co19/src/Language/11_Expressions/11_Instance_Creation_A05_t02.dart': Error: line 25 pos 19: type arguments of type 'G<double, double>' are not within bounds
    var o = const G<double, double>();
                  ^


Added Accepted label.

@crelier
Copy link
Contributor

crelier commented Jan 2, 2013

Closing again. Reporting a compile-time error is correct, because a constant instance is created.
It is a compile-time error if evaluation of a constant object results in an uncaught exception being thrown.


Added AsDesigned label.

@DartBot DartBot added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-as-intended Closed as the reported issue is expected behavior labels Jan 2, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-as-intended Closed as the reported issue is expected behavior
Projects
None yet
Development

No branches or pull requests

4 participants