wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps

Home Page:https://wurstlang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[compiletime] `LinkedList<unit>` contains different `handle` value

GetLocalPlayer opened this issue · comments

@Test
function _LLTest()
	let u = createUnit(localPlayer, 'hfoo', ZERO2, angle(0))
	let list = new LinkedList<unit>
	list.add(u)
	print(u.getHandleId())
	print(list.get(0).getHandleId())
	assertTrue(u == list.get(0))

Compiletime output:

Running <Hello:26 - _LLTest>..
1240419865
1242175980
	FAILED assertion:
	Test failed: Assertion failed
... when calling assertTrue(false) in Hello.wurst:32
... when calling _LLTest() in Hello.wurst:26

Tests succeeded: 0/1

I guess it's for handles in general, since for group type is the same.

Yes. This could only be adressed via new type classes, because current generics work via typecasting which will result in a new handle at compiletime.

Understandable.
I'm closing then I guess.