-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
% dart --version
Dart SDK version: 3.3.1 (stable) (Wed Mar 6 13:09:19 2024 +0000) on "macos_arm64"
The following code does successfully execute, and gets highlighting, but depending on the tool (VSCode, Dartpad, etc) the syntax highlighting is off.
void main() {
final code = StringBuffer();
final data = null as dynamic;
code.writeln(
'final cards = <CardOrVariant>${_createList([
...data.cards.map(
(c) => _invokeConstructor(
'CanonicalCard',
{
'card': _nameToIdentifier(c.title),
},
indent: ' ',
),
),
..._collectVariants(data.cards, count: data.count),
])};',
);
}
String _createList(
Iterable<String> elements,
) {
throw UnimplementedError();
}
String _nameToIdentifier(String name) {
throw UnimplementedError();
}
String _invokeConstructor(
String name,
Map<String, String> fields, {
String indent = '',
}) {
throw UnimplementedError();
}
Iterable<String> _collectVariants(
Iterable<Never> cards, {
required int count,
}) {
throw UnimplementedError();
}
Example in VSCode, the trailing ])};',
all look like they are in a string, but they are within ${...}
blocks.
Dartpad looks worse (even more of the expression is highlighted as a string):
Metadata
Metadata
Assignees
Labels
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)