New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dartfmt crash: type 'LabelImpl' is not a subtype of type 'SwitchMember' #34453

Closed
alexmarkov opened this Issue Sep 12, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@alexmarkov
Contributor

alexmarkov commented Sep 12, 2018

On a fresh checkout of Dart SDK:

tools/build.py -m release create_sdk
out/ReleaseX64/dart-sdk/bin/dartfmt pkg/vm/testcases/bytecode/switch.dart
Hit a bug in the formatter when formatting pkg/vm/testcases/bytecode/switch.dart.
Please report at github.com/dart-lang/dart_style/issues.
type 'LabelImpl' is not a subtype of type 'SwitchMember'
#0      AstBuilder.popTypedList (package:analyzer/src/fasta/ast_builder.dart:2800:15)
#1      AstBuilder.endSwitchCase (package:analyzer/src/fasta/ast_builder.dart:1331:34)
#2      Parser.parseStatementsInSwitchCase (package:front_end/src/fasta/parser/parser.dart:5543:14)
#3      Parser.parseSwitchBlock (package:front_end/src/fasta/parser/parser.dart:5489:15)
#4      Parser.parseSwitchStatement (package:front_end/src/fasta/parser/parser.dart:5420:13)
#5      Parser.parseStatementX (package:front_end/src/fasta/parser/parser.dart:3458:14)
#6      Parser.parseStatement (package:front_end/src/fasta/parser/parser.dart:3418:20)
#7      Parser.parseFunctionBody (package:front_end/src/fasta/parser/parser.dart:3323:15)
#8      Parser.parseTopLevelMethod (package:front_end/src/fasta/parser/parser.dart:2262:13)
#9      Parser.parseTopLevelMemberImpl (package:front_end/src/fasta/parser/parser.dart:2165:14)
#10     Parser.parseTopLevelDeclarationImpl (package:front_end/src/fasta/parser/parser.dart:479:14)
#11     Parser.parseUnit (package:front_end/src/fasta/parser/parser.dart:334:15)
#12     ParserAdapter.parseCompilationUnit2 (file:///usr/local/google/home/alexmarkov/work/dart/sdk/pkg/analyzer/lib/src/generated/parser_fasta.dart:150:32)
#13     ParserAdapter.parseCompilationUnit (file:///usr/local/google/home/alexmarkov/work/dart/sdk/pkg/analyzer/lib/src/generated/parser_fasta.dart:145:12)
#14     DartFormatter.formatSource (package:dart_style/src/dart_formatter.dart:119:21)
#15     processFile (package:dart_style/src/io.dart:77:28)
#16     formatPaths (file:///usr/local/google/home/alexmarkov/work/dart/sdk/third_party/pkg_tested/dart_style/bin/format.dart:254:12)
#17     main (file:///usr/local/google/home/alexmarkov/work/dart/sdk/third_party/pkg_tested/dart_style/bin/format.dart:182:5)
#18     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#19     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

It's a recent regression: I was able to format pkg/vm with dartfmt without errors before.

@alexmarkov alexmarkov added the type-bug label Sep 12, 2018

@vsmenon

This comment has been minimized.

Show comment
Hide comment
@vsmenon

vsmenon Sep 20, 2018

Member

@munificent - is there an area for formatter bugs (and perhaps this is a fasta one)?

Member

vsmenon commented Sep 20, 2018

@munificent - is there an area for formatter bugs (and perhaps this is a fasta one)?

@bwilkerson

This comment has been minimized.

Show comment
Hide comment
@bwilkerson

bwilkerson Sep 20, 2018

Member

This is an analyzer bug.

@danrubel Do you have time to take a look?

Member

bwilkerson commented Sep 20, 2018

This is an analyzer bug.

@danrubel Do you have time to take a look?

@danrubel danrubel self-assigned this Sep 21, 2018

@dart-bot dart-bot closed this in 7cd2570 Sep 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment