void main () { const int FOO = 23; FooFunc foo = () => { var i = FOO; }; }
Removing the 'const' fixes the issue.
Version: 0.40.x