HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.18k stars 655 forks source link

Issue 1688 - AST problem with WeakMap assigned to Map - haxe #1688

Closed issuesbot closed 11 years ago

issuesbot commented 11 years ago

[Google Issue #1688 : https://code.google.com/p/haxe/issues/detail?id=1688] by si...@haxe.org, at 12/04/2013, 12:43:09

class Main {
    public function new() { }
    public static function main() {
        var map:Map<Main, String> = new haxe.ds.WeakMap();
        map.set(new Main(), "bar");
        for (i in map) {
            trace(i);
        }
    }
}

The multitype resolution causes map to become an ObjectMap: ((((Local map:319 : haxe.ds.ObjectMap<Main, String>)[(New Main() : Main)] : String) = (Const "bar" : String)) : Unknown<0>);

This causes DCE issues, possibly among other things.

issuesbot commented 11 years ago

[comment from si...@haxe.org, published at 12/04/2013, 13:32:19] I can't see how this would be easily fixed at the moment, so we should disallow the assignment for now.

issuesbot commented 11 years ago

[comment from si...@haxe.org, published at 13/04/2013, 13:06:18] This issue was closed by revision b3748ceaa5310a9f8017c27538583e4a31d78b2e.