-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Unable to evaluate expressions with top level symbols like print
or class names
#18160
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
Comments
I think this is a dart2 issue - when the CFE is enabled by default. /cc @aam, who's been working expression evaluation in dart2. Alex, is there any new guidance in using expr. eval w/ the CFE enabled? |
Currently, in Flutter engine expressions are evaluated in dart1 mode by dart1-compilant parser that is built-in into engine's dart vm. With https://dart-review.googlesource.com/c/sdk/+/49061 and #16161 it will get switched to using flutter tools dart2 frontend for expression compilation. Having said that, I am not sure what is the cause for errors above. Are you able to reproduce those failures if you use expression evaluation in observatory for Flutter app? |
@aam Yep, same thing in Observatory web app:
(FWIW, I did try passing |
Since I have a screenshot showing this working from only a couple of weeks ago, if it's useful I could bisect this and find out which changesets work/fail if it's useful (it'll be a little bit manual, so I'm only gonna do it if you think it'd be useful). |
Yeah @DanTup , if you could let me know what revision of Flutter |
Ah, I realized just now I was not going far enough back to find working version of Flutter. Turns out it got broken back in March with culprit being 71b2cfb |
This should get fixed with the switch to dart2 frontend for expression compilation mentioned above in #18160 (comment) |
Weird, I must've somehow been on a really old version of Flutter when I coded this (which is possible, I do have many versions checked out from testing; but I hadn't deliberately been using them recently!). Is switching the expression compilation to Dart 2 far off? |
Hopefully it happens today |
This should be fixed in f11c8d9. |
@aam there's a report in flutter-dev of evaluation issues recently - I'm not sure if they may have been introduced with this change: https://groups.google.com/forum/#!topic/flutter-dev/O-mTAk00hos I can't reproduce any issues myself so have asked for more info, but thought I'd give you a heads up. I'll open a new issue and ping you on it if I can get a repro/log file. |
thanks for the heads up @DanTup |
7e205b3 Roll src/fuchsia/sdk/mac from 1MVsE... to 4MCVP... (flutter#18217) 9193d8f Roll src/third_party/skia 0dc207f836da..a14084ba1b41 (3 commits) (flutter#18219) 403931f Add FlValue (flutter#18185) 46a6d96 [SkParagraph] Copy text height behavior to the Skia paragraph style (flutter#18178) e7ee47d [web] Implement matrix parameter for linear gradient (flutter#18208) 28d9985 Reland again "Remove layer integral offset snapping flutter#17112" (flutter#18160) 5e361f5 Roll src/third_party/skia c66cd987f7c0..0dc207f836da (5 commits) (flutter#18212) 716dbf0 Refactor GLFW embedding to support headless mode (flutter#18205) 23cca32 Manual Roll of Dart 39e0e75fcf...ce62ad2e8b (flutter#18211) 15f72b8 Support EventChannel C++ plugin API for Linux/Windows (flutter#17015) e5a7ca5 Handle leak of message handle when no engine present (flutter#18157) d3bde19 add docs to platformviewios (and some drive-by changes) (flutter#17593) b582d77 Roll src/third_party/skia 0066adefa97d..c66cd987f7c0 (4 commits) (flutter#18206) 5e7d6d0 Roll src/third_party/skia edea19858ccc..0066adefa97d (3 commits) (flutter#18203) 88b9d42 Remove the global engine entry timestamp (flutter#18182) 0dffdd5 Roll src/third_party/dart e86e4d61834a..ce62ad2e8b40 (13 commits) (flutter#18201) 56fe6d2 Roll src/third_party/skia 2871ab0727bf..edea19858ccc (3 commits) (flutter#18198) bcdf991 Fixed ChildSceneLayer elevation issue on Fuchsia. (flutter#18144) ede658e [profiling] CPU Profiling support for iOS (flutter#18087) d043923 Roll src/third_party/skia e3d1de7c5281..2871ab0727bf (1 commits) (flutter#18197) 807f191 Roll src/third_party/dart 733153eb517c..e86e4d61834a (6 commits) (flutter#18195) fe3f8df Roll src/third_party/skia 3b2db26c59d6..e3d1de7c5281 (4 commits) (flutter#18192) 34b0629 Roll fuchsia/sdk/core/mac-amd64 from jMJqf... to 1MVsE... (flutter#18194) e9b2afe Roll fuchsia/sdk/core/linux-amd64 from RpHTv... to MhpFP... (flutter#18191) 35fa006 Roll src/third_party/skia 88d04cb51acf..3b2db26c59d6 (1 commits) (flutter#18190) e54bb9e Roll src/third_party/dart 4da5b40fb6dc..733153eb517c (23 commits) (flutter#18188)
7e205b3 Roll src/fuchsia/sdk/mac from 1MVsE... to 4MCVP... (flutter#18217) 9193d8f Roll src/third_party/skia 0dc207f836da..a14084ba1b41 (3 commits) (flutter#18219) 403931f Add FlValue (flutter#18185) 46a6d96 [SkParagraph] Copy text height behavior to the Skia paragraph style (flutter#18178) e7ee47d [web] Implement matrix parameter for linear gradient (flutter#18208) 28d9985 Reland again "Remove layer integral offset snapping flutter#17112" (flutter#18160) 5e361f5 Roll src/third_party/skia c66cd987f7c0..0dc207f836da (5 commits) (flutter#18212) 716dbf0 Refactor GLFW embedding to support headless mode (flutter#18205) 23cca32 Manual Roll of Dart 39e0e75fcf...ce62ad2e8b (flutter#18211) 15f72b8 Support EventChannel C++ plugin API for Linux/Windows (flutter#17015) e5a7ca5 Handle leak of message handle when no engine present (flutter#18157) d3bde19 add docs to platformviewios (and some drive-by changes) (flutter#17593) b582d77 Roll src/third_party/skia 0066adefa97d..c66cd987f7c0 (4 commits) (flutter#18206) 5e7d6d0 Roll src/third_party/skia edea19858ccc..0066adefa97d (3 commits) (flutter#18203) 88b9d42 Remove the global engine entry timestamp (flutter#18182) 0dffdd5 Roll src/third_party/dart e86e4d61834a..ce62ad2e8b40 (13 commits) (flutter#18201) 56fe6d2 Roll src/third_party/skia 2871ab0727bf..edea19858ccc (3 commits) (flutter#18198) bcdf991 Fixed ChildSceneLayer elevation issue on Fuchsia. (flutter#18144) ede658e [profiling] CPU Profiling support for iOS (flutter#18087) d043923 Roll src/third_party/skia e3d1de7c5281..2871ab0727bf (1 commits) (flutter#18197) 807f191 Roll src/third_party/dart 733153eb517c..e86e4d61834a (6 commits) (flutter#18195) fe3f8df Roll src/third_party/skia 3b2db26c59d6..e3d1de7c5281 (4 commits) (flutter#18192) 34b0629 Roll fuchsia/sdk/core/mac-amd64 from jMJqf... to 1MVsE... (flutter#18194) e9b2afe Roll fuchsia/sdk/core/linux-amd64 from RpHTv... to MhpFP... (flutter#18191) 35fa006 Roll src/third_party/skia 88d04cb51acf..3b2db26c59d6 (1 commits) (flutter#18190) e54bb9e Roll src/third_party/dart 4da5b40fb6dc..733153eb517c (23 commits) (flutter#18188)
7e205b3 Roll src/fuchsia/sdk/mac from 1MVsE... to 4MCVP... (#18217) 9193d8f Roll src/third_party/skia 0dc207f836da..a14084ba1b41 (3 commits) (#18219) 403931f Add FlValue (#18185) 46a6d96 [SkParagraph] Copy text height behavior to the Skia paragraph style (#18178) e7ee47d [web] Implement matrix parameter for linear gradient (#18208) 28d9985 Reland again "Remove layer integral offset snapping #17112" (#18160) 5e361f5 Roll src/third_party/skia c66cd987f7c0..0dc207f836da (5 commits) (#18212) 716dbf0 Refactor GLFW embedding to support headless mode (#18205) 23cca32 Manual Roll of Dart 39e0e75fcf...ce62ad2e8b (#18211) 15f72b8 Support EventChannel C++ plugin API for Linux/Windows (#17015) e5a7ca5 Handle leak of message handle when no engine present (#18157) d3bde19 add docs to platformviewios (and some drive-by changes) (#17593) b582d77 Roll src/third_party/skia 0066adefa97d..c66cd987f7c0 (4 commits) (#18206) 5e7d6d0 Roll src/third_party/skia edea19858ccc..0066adefa97d (3 commits) (#18203) 88b9d42 Remove the global engine entry timestamp (#18182) 0dffdd5 Roll src/third_party/dart e86e4d61834a..ce62ad2e8b40 (13 commits) (#18201) 56fe6d2 Roll src/third_party/skia 2871ab0727bf..edea19858ccc (3 commits) (#18198) bcdf991 Fixed ChildSceneLayer elevation issue on Fuchsia. (#18144) ede658e [profiling] CPU Profiling support for iOS (#18087) d043923 Roll src/third_party/skia e3d1de7c5281..2871ab0727bf (1 commits) (#18197) 807f191 Roll src/third_party/dart 733153eb517c..e86e4d61834a (6 commits) (#18195) fe3f8df Roll src/third_party/skia 3b2db26c59d6..e3d1de7c5281 (4 commits) (#18192) 34b0629 Roll fuchsia/sdk/core/mac-amd64 from jMJqf... to 1MVsE... (#18194) e9b2afe Roll fuchsia/sdk/core/linux-amd64 from RpHTv... to MhpFP... (#18191) 35fa006 Roll src/third_party/skia 88d04cb51acf..3b2db26c59d6 (1 commits) (#18190) e54bb9e Roll src/third_party/dart 4da5b40fb6dc..733153eb517c (23 commits) (#18188)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I recently implemented something called "log points" in Dart Code where we let the user provide an expression and we wrap it in
print()
and send it to the debugger viaevaluateInFrame
. At some point in the past, I'm certain this worked fine:However today, this seems completely broken. I've tried various versions of Flutter and Dart Code and can't make the example in the screenshot work at all (I even went back several beta versions). However, the same thing seems to work fine in Dart VM scripts.
Here's what I get back from the VM in Flutter when trying to use
print
:And here's what happens if I try to use a class name like
DateTime
:As well as affecting log points, this happens from the Debug Console, so if the user types
(new DateTime.now()).year
into the Debug Console for a Dart CLI script it works fine, but in Flutter it fails. Using the Flutter version of the SDK for both tests.The text was updated successfully, but these errors were encountered: