Skip to content

dart_bin checked-mode: generics extension error #718

New issue

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

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

Already on GitHub? # to your account

Closed
DartBot opened this issue Dec 7, 2011 · 2 comments
Closed

dart_bin checked-mode: generics extension error #718

DartBot opened this issue Dec 7, 2011 · 2 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@DartBot
Copy link

DartBot commented Dec 7, 2011

This issue was originally filed by karl.kruk...@gmail.com


I have a generic type Pair<P,Q> that I want to extend a generic super class.
This seems to generate a checked_mode error when the super class has one type param.

class A<E>{}
class Pair<P,Q> extends A {
  final P fst;
  final Q snd;
  Pair(this.fst,this.snd);

}
main() {
  print(new Pair<int,int>(1,2));//OK no problems

  print(new Pair<String,int>("1",2));//checked-mode type err
}

krukow:~/scratchpad$ dart_bin --enable_type_checks generic.dart
Instance of 'Pair<int, int>'
Unhandled exception:
Failed type check: type Smi is not assignable to type String of snd in /Users/krukow/scratchpad/generic.dart at line 5, column 22.
 0. Function: 'Pair.Pair.' url: '/Users/krukow/scratchpad/generic.dart' line:5 col:22
 1. Function: '::.main' url: '/Users/krukow/scratchpad/generic.dart' line:12 col:9
 

where as if it has two:
class A<E,F>{}
we get:
krukow:~/scratchpad$ dart_bin --enable_type_checks generic.dart
Instance of 'Pair<int, int>'
Instance of 'Pair<String, int>'

Using dart_bin as of Dec. 6th.

@ghost
Copy link

ghost commented Dec 7, 2011

Set owner to @crelier.
Added Area-VM, Triaged labels.

@crelier
Copy link
Contributor

crelier commented Dec 8, 2011

Fixed in r2286.


Added Fixed label.

@DartBot DartBot added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Dec 8, 2011
copybara-service bot pushed a commit that referenced this issue Aug 5, 2022
…ions)

https://dart.googlesource.com/protobuf/+log/504eefeae989..11983dafc427

2022-08-05 omersa@google.com Revert "Fix presence of bytes fields (#715)"
2022-08-05 omersa@google.com Document use case for `GeneratedMessage.createEmptyInstance` (#711)
2022-08-05 omersa@google.com Avoid redundant copying when deserializing binary messages (#718)
2022-08-05 omersa@google.com Remove unused `UnknownFieldSetField` methods (#721)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: Ie9e2a5e4dde92f80858124efe4b9e131ade0d345
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253724
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

2 participants