Skip to content

Expression evaluation error in VM service protocol with extension method #52522

Closed

Description

@stevemessick

To reproduce:

  • create a sample Flutter project
  • add an extension method
  • call the method from the sample
  • add a watch on a variable defined in the extension method
  • run it
extension on String {
  parseInt() {
    var temp = 'temp';
    return int.parse(this);
  }
}

In _incrementCounter():

      _counter++;
      '42'.parseInt();

I had watches on _counter and temp.
The request was evaluateInFrame.
The stack trace returned with the error JSON (think it was the same for both):

#0      HotRunner._compileExpressionService (package:flutter_tools/src/run_hot.dart:210:5)
<asynchronous suspension>
#1      setUpVmService.<anonymous closure> (package:flutter_tools/src/vmservice.dart:264:40)
<asynchronous suspension>
#2      VmService._routeRequest (package:vm_service/src/vm_service.dart:2548:14)
<asynchronous suspension>
#3      VmService._processRequest (package:vm_service/src/vm_service.dart:2518:19)
<asynchronous suspension>

Context: flutter/flutter-intellij#6736

Activity

  1. mkustermann commented on May 26, 2023

    @mkustermann
    Member

    /cc @aam would you be interested in looking at this? (I seem to recall you worked on expression evaluation before)

  2. added
    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
    on May 26, 2023
  3. self-assigned this
    on May 26, 2023
  4. aam commented on May 30, 2023

    @aam
    Contributor
  5. aam commented on Jun 2, 2023

    @aam
    Contributor

    Keep opened until it lands in flutter

  6. reopened this on Jun 2, 2023
  7. aam commented on Jun 8, 2023

    @aam
    Contributor

    Landed in flutter flutter/flutter@09c0706

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

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.legacy-area-front-endLegacy: Use area-dart-model instead.vm-debugger

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions