-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.model-crashesCrashes in the analyzer or CFECrashes in the analyzer or CFE
Description
This code crashes when issuing errors because there's no name:
$ cat pkg/front_end/testcases/regress/duplicate_unnamed.dart
// Copyright (c) 2024, 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.
void foo(dynamic bar) {
final [ void, void ] = bar;
}
Allowing there to be no name it crashes upon loading the serialized dill because on serializing the empty name becomes null and the name is only allowed to be null if it's synthetic.
If making it synthetic the serialized-and-loaded-back-again version is different from the version that isn't:
- final synthesized hoisted has-declared-initializer void;
- final synthesized hoisted void = invalid-expression "pkg/front_end/testcases/regress/duplicate_unnamed.dart:6:22: Error: '(unnamed)' is already declared in this scope.
+ final hoisted has-declared-initializer void #t1;
+ final hoisted void #t2 = invalid-expression "pkg/front_end/testcases/regress/duplicate_unnamed.dart:6:22: Error: '(unnamed)' is already declared in this scope.
While I think this situation should just be accepted I can't come up with an easy/good (or any, currently) way of making this not crash or be bad in some way.
Metadata
Metadata
Assignees
Labels
legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.model-crashesCrashes in the analyzer or CFECrashes in the analyzer or CFE