Skip to content
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

show value in dart vm dynamic type check #715

Closed
DartBot opened this issue Dec 7, 2011 · 2 comments
Closed

show value in dart vm dynamic type check #715

DartBot opened this issue Dec 7, 2011 · 2 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-as-intended Closed as the reported issue is expected behavior

Comments

@DartBot
Copy link

DartBot commented Dec 7, 2011

This issue was originally filed by mattsh@google.com


When I have a failing type check on the dart vm (for example, here I am attempting to assign an integer to a double:

main() {
  double a = 23;
}

it prints:

Failed type check: type 'Smi' is not assignable to type 'double' of 'a'.

This is useful. But it would be good to include the actual value as well. So something like this would be good I think:

Failed type check: type 'Smi' (23) is not assignable to type 'double' of 'a'.

I'm not sure yet of the best formatting exactly, but for now if we could dump the actual value in there somewhere, that would help.

Actually, I notice that class TypeError currently has these fields:
  final String srcType;
  final String dstType;
  final String dstName;

I think we should have one more field to hold the offending value.

@iposva-google
Copy link
Contributor

How much are you willing to print? What if the value you are assigning is an array with 1000 elements? I do not think it is feasible to hold on to the value as this can cause an otherwise dead object to be preserved. We could choose to print the value for well-known types for which we know the implementation of toString.

@iposva-google
Copy link
Contributor

None of the follow up questions were addressed. Closing.


Added AsDesigned label.

@DartBot DartBot added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-as-intended Closed as the reported issue is expected behavior labels Jun 1, 2012
copybara-service bot pushed a commit that referenced this issue Jun 14, 2022
Changes:
```
> git log --format="%C(auto) %h %s" 2993ea5..0c22930
 https://dart.googlesource.com/http.git/+/0c22930 Add browser support for response header tests. (#716)
 https://dart.googlesource.com/http.git/+/9f1416e A browser tests for request headers. (#715)
 https://dart.googlesource.com/http.git/+/557d9a3 Support executing tests when run as a package (#714)
 https://dart.googlesource.com/http.git/+/2b4f988 Set async min version to match pinned flutter version (#713)
 https://dart.googlesource.com/http.git/+/a479221 Add browser tests for the response body. (#712)
 https://dart.googlesource.com/http.git/+/0e20ff9 Run the request body tests against the browser client. (#711)
 https://dart.googlesource.com/http.git/+/c09fb1d Run the redirect tests against the browser client. (#708)
 https://dart.googlesource.com/http.git/+/2f723b0 Use the Uri.http constructor in docs and tests (#707)
 https://dart.googlesource.com/http.git/+/346f25d add a LICENSE file; tweaks to the readmes (#709)
 https://dart.googlesource.com/http.git/+/9700bb0 Add a conformance test package for http Clients (#706)
 https://dart.googlesource.com/http.git/+/ae8a9a8 Fix the repository page for monorepoization (#705)
 https://dart.googlesource.com/http.git/+/06649af Mono (#704)

```

Diff: https://dart.googlesource.com/http.git/+/2993ea5dff5ffb066b4a35c707e7a2b8dcfa17c2~..0c2293062d7c1fa472f299da764a7dbb3895ee22/
Change-Id: I967ccd6cc1fda757696099ededc53dbbf942e6a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248351
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
copybara-service bot pushed a commit that referenced this issue Aug 5, 2022
…ions)

https://dart.googlesource.com/protobuf/+log/504eefeae989..11983dafc427

2022-08-05 omersa@google.com Revert "Fix presence of bytes fields (#715)"
2022-08-05 omersa@google.com Document use case for `GeneratedMessage.createEmptyInstance` (#711)
2022-08-05 omersa@google.com Avoid redundant copying when deserializing binary messages (#718)
2022-08-05 omersa@google.com Remove unused `UnknownFieldSetField` methods (#721)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: Ie9e2a5e4dde92f80858124efe4b9e131ade0d345
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253724
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-as-intended Closed as the reported issue is expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants