Skip to content

[CFE] Incremental compilation fails for optimized-away constants #41999

Open
@annagrin

Description

@annagrin

Example

void main() {
  const int p = 1;
  print(p); // breakpoint here
}

Javascript from initial compilation

For main function only, is here to illustrate that kernel representation has variable 'p' optimized away:

main.main = function main$() {
  core.print(1);
};

Result of evaluating ‘p’ at the breakpoint above

CompilationError: Getter not found: 'p'

Suggestions

Is it possible to introduce debug mode in CFE where the information about optimized variables (such as 'p=1') is preserved so the incremental compiler can use it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    legacy-area-front-endLegacy: Use area-dart-model instead.web-evalevaluation support on the web

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions