Skip to content

[vm] Type parameter bounds of tearoffs are printed incorrectly #34308

Closed
@sjindel-google

Description

@sjindel-google

The following test illustrates this issue:

// Copyright (c) 2018, 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.
//
// This test checks that necessary type argument bounds checks are performed
// eagerly during partial instantiation, rather than being delayed until the
// partially instantiated closure is invoked.

import "package:expect/expect.dart";

class C<T> {
  void foo<S extends T>(S x) {}
}

typedef fooCorrectType = void Function<S extends int>(S x);

void main() {
  dynamic c = C<int>();
  dynamic fn = c.foo;
  Expect.equals("${fn.runtimeType}", "$fooCorrectType");
}

@mraleph @crelier

Metadata

Metadata

Labels

P2A bug or feature request we're likely to work onarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions