-
-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] do not create temp vars for non-TInst TFuns (closes #5082)
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package unit.issues; | ||
|
||
private enum E { | ||
Tiles(x:Dynamic); | ||
TileInstances(x:Dynamic); | ||
} | ||
|
||
@:keep | ||
private class Content { | ||
public var find:String -> Content; | ||
public function new() { | ||
find = function(s:String) return this; | ||
} | ||
|
||
public function spectrum(s:String, d:Dynamic) { | ||
return this; | ||
} | ||
|
||
public function closest(s:String) { | ||
return this; | ||
} | ||
|
||
public function css(s:String) { | ||
return "foo"; | ||
} | ||
} | ||
|
||
class Issue5082 extends unit.Test { | ||
function test() { | ||
var l = {data: Tiles([]), props:{color:""}, idToIndex: null}; | ||
var content = new Content(); | ||
var x = (untyped content.find("[name=color]")).spectrum("set", toColor(l.props.color)).closest(".item").css( { display : l.idToIndex == null && !l.data.match(Tiles(_) | TileInstances(_)) ? "" : "none" } ); | ||
eq("foo", x); | ||
} | ||
|
||
static function toColor(d:Dynamic) return d; | ||
} |