Skip to content

Parsing of a unit with errors throws #30266

@scheglov

Description

@scheglov

The following program causes an exception to be thrown.
Analyzer does not throw any exceptions for this code.

const int x = 0x;

Exception:

  @14: A hex digit (0-9 or A-F) must follow '0x'.
  null
  package:front_end/src/fasta/parser/listener.dart 1064:5            Listener.handleUnrecoverableError
  package:front_end/src/fasta/source/directive_listener.dart 121:42  DirectiveListener.handleUnrecoverableError
  package:front_end/src/fasta/parser/parser.dart 3993:29             Parser.reportErrorToken
  package:front_end/src/fasta/parser/parser.dart 3948:14             Parser.reportUnrecoverableErrorWithToken
  package:front_end/src/fasta/parser/parser.dart 877:17              Parser.parseIdentifier
  package:front_end/src/fasta/parser/parser.dart 1089:17             Parser.parseType.commitType
  package:front_end/src/fasta/parser/parser.dart 1143:26             Parser.parseType
  package:front_end/src/fasta/parser/parser.dart 2031:13             Parser.parseModifiers
  package:front_end/src/fasta/parser/parser.dart 1548:19             Parser.parseFields
  package:front_end/src/fasta/parser/parser.dart 1533:11             Parser.parseTopLevelMember
  package:front_end/src/fasta/parser/parser.dart 265:14              Parser._parseTopLevelDeclaration
  package:front_end/src/fasta/parser/parser.dart 237:13              Parser.parseTopLevelDeclaration
  package:front_end/src/fasta/parser/parser.dart 229:15              Parser.parseUnit
  package:front_end/src/incremental/unlinked_unit.dart 25:32         computeUnlinkedUnit
  package:front_end/src/incremental/file_state.dart 156:23           FileState.refresh
  ===== asynchronous gap ===========================
  package:front_end/src/incremental/file_state.dart 357:18           FileSystemState.getFile
  ===== asynchronous gap ===========================
  package:front_end/src/incremental/kernel_driver.dart 128:31        KernelDriver.getKernel.<fn>.<fn>

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions