File tree 2 files changed +28
-0
lines changed
pkg/dev_compiler/lib/src/compiler
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ Set<TypeParameterElement> freeTypeParameters(DartType t) {
16
16
if (t is TypeParameterType ) {
17
17
result.add (t.element);
18
18
} else if (t is FunctionType ) {
19
+ // Visit type arguments of typedefs, because we use these when we're
20
+ // emitting the type.
21
+ if (t.name != '' && t.name != null ) {
22
+ t.typeArguments.forEach (find);
23
+ }
19
24
find (t.returnType);
20
25
t.parameters.forEach ((p) => find (p.type));
21
26
t.typeFormals.forEach ((p) => find (p.bound));
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ import 'package:expect/expect.dart' ;
6
+
7
+ class Foo {}
8
+
9
+ class Bar {}
10
+
11
+ typedef Type Func <S extends Foo , T >(T s);
12
+
13
+ class Baz <S extends Foo , T extends Bar > {
14
+ Func <S , Bar > func;
15
+ }
16
+
17
+ /// Regression test for https://github.com/dart-lang/sdk/issues/30912
18
+ void main () {
19
+ dynamic baz = new Baz ();
20
+ Expect .isNull (baz.func);
21
+ baz.func = (Bar b) => b.runtimeType;
22
+ Expect .equals (baz.func (new Bar ()), Bar );
23
+ }
You can’t perform that action at this time.
0 commit comments