40ad7aee40
Previously a named function expression (function declaration occurring in an expression context) was encoded using a [NamedFunctionExpressionJudgment] which was a specialization of a [Let] expression. This encoding couldn't handle recursive calls occurring in the body of the named function expression, since the let variable is not available in the initializer of the let variable, leading to a crash in serialization. This CL changes the encoding to use a [BlockExpression] instead and deletes the [NamedFunctionExpressionJudgment] node. Closes https://github.com/dart-lang/sdk/issues/49122 Change-Id: I40c5535624b2d8933a6f400c927ba42b028f7a29 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246445 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
10 lines
309 B
Dart
10 lines
309 B
Dart
// Copyright (c) 2017, 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.
|
|
|
|
test() {
|
|
var x = void f<T>(T t) {};
|
|
print(x.runtimeType);
|
|
print(void g<T>(T t) {});
|
|
}
|