Description
What steps will reproduce the problem?
- Run date_time_format_tests.dart. The files expect to be in the same place as in the normal source tree, that is dart/lib/i18n and dart/tests/lib/i18n for the tests.
What is the expected output? What do you see instead?
Expected output is probably a test failure or other error, since this is code in the middle of an experiment. Instead the VM exits with status 138.
What version of the product are you using? On what operating system?
Editor build 8641. Mac OS X 10.7.4
Please provide any additional information below.
date_time_symbols.dart is a bit of hacked up Javascript that defines lots and lots of locales as constant maps. It has one method, setup() that looks at the current locale and sets a variable DateTimeSymbols to be the correct one of these.
date_format.dart is a class for date formatting. It defines a library and imports date_time_symbols.
_date_format_field.dart is a helper class. date_format sources it. It needs to access the DateTimeSymbols variable.
In _date_format_field I created a getter for the DateTimeSymbols variable that just did lazy initialization. However, I didn't think carefully and I just named it the same as the variable. So, in effect, I had a variable in my package that was shadowing an imported variable. Neither the editor nor the VM complained about that, but the VM crashed when it got to that point. I spend a bit of time setting up the same situation in a simpler case, but it just went infinite recursive, which is more what I'd expect. Naming the getter something different caused the problem to go away.
Attachments:
date_format.dart (13.97 KB)
_date_format_field.dart (3.66 KB)
date_time_symbols.dart (154.08 KB)
date_time_format_test.dart (2.14 KB)