xxgreg / mustache

Mustache template Dart library
BSD 2-Clause "Simplified" License
57 stars 59 forks source link

Avoid invocation of Object. #32

Closed stereotype441 closed 6 years ago

stereotype441 commented 6 years ago

In Dart 2.0, it will become a compile-time error to try to perform a function invocation on a variable whose static type is Object (see https://github.com/dart-lang/sdk/issues/31509). Since value is changed inside the if block, it is not type promoted, so its type is considered to be Object. Therefore, to avoid a compile-time error, we need to use an intermediate variable of type Function.

xxgreg commented 6 years ago

Merged and published in 1.0.1. Cheers.