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

Tests using toString on a run-time type cannot work with minification #31054

Open
eernstg opened this issue Oct 10, 2017 · 1 comment
Open

Tests using toString on a run-time type cannot work with minification #31054

eernstg opened this issue Oct 10, 2017 · 1 comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). gardening type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@eernstg
Copy link
Member

eernstg commented Oct 10, 2017

The following tests in sdk/tests/language_2 use e.toString() to get a string representation of a given run-time type (e has type Type), and compares the result to string literals:

cyclic_type2_test
cyclic_type_test/0*
f_bounded_quantification5_test
generic_closure_test
mixin_mixin2_test
mixin_mixin3_test
mixin_mixin4_test
mixin_mixin5_test
mixin_mixin6_test
mixin_mixin_bound2_test
mixin_mixin_bound_test

As mentioned in issue #12605, no guarantees are given for the return value of toString, including the one on Type, and in particular the output looks very different for user-defined classes and for the class Map in $minified mode.

Only generic_closure_test avoids user-defined classes and Map, so it may work, but the others will inherently fail with $minified.

This issue exists to make sure this situation is known, and it may be used to track an update to the tests (if that's given priority). I haven't given the issue area-dart2js because this is a problem with the tests, not with dart2js.

@eernstg eernstg added gardening type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Oct 10, 2017
@anders-sandholm anders-sandholm added the area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). label Oct 11, 2017
@eernstg
Copy link
Member Author

eernstg commented Oct 11, 2017

Note that #31053 was created in response to the same problem that this issue addresses, and it was closed because this issue subsumes #31053.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). gardening type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants