wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps
https://wurstlang.org
Apache License 2.0
225 stars 30 forks source link

Misleading warnings in lambdas expression declaration #965

Closed zhylmzr closed 4 years ago

zhylmzr commented 4 years ago

Describe the bug The compiler reports that constants local should be defined with let, but it and lambdas expression cannot automatically infer conflicts.

@Test public function foo()
    Predicate<int> pred = (v) -> v mod 2 == 0
    pred.isTureFor(10)

interface Predicate<T>
    function isTureFor(T t) returns bool

Snipaste_2020-09-21_17-59-05

Frotty commented 4 years ago

duplicate of https://github.com/wurstscript/WurstScript/issues/930