File tree Expand file tree Collapse file tree
de.peeeq.wurstscript/src/test/java/tests/wurstscript/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1843,5 +1843,39 @@ public void arrayListInClosure() {
18431843 );
18441844 }
18451845
1846+ @ Test
1847+ public void genericClassWithModule () {
1848+ testAssertOkLines (true ,
1849+ "package test" ,
1850+ "native testSuccess()" ,
1851+ "module M" ,
1852+ " static thistype first = null" ,
1853+ " static thistype last = null" ,
1854+ " static int size = 0" ,
1855+ " thistype prev" ,
1856+ " thistype next" ,
1857+ " construct()" ,
1858+ " size++" ,
1859+ " if size == 1" ,
1860+ " first = this" ,
1861+ " prev = null" ,
1862+ " else" ,
1863+ " last.next = this" ,
1864+ "class Box<T:>" ,
1865+ " use M" ,
1866+ " private T value" ,
1867+ " function setValue(T v)" ,
1868+ " value = v" ,
1869+ " function getValue() returns T" ,
1870+ " return value" ,
1871+ "init" ,
1872+ " let b = new Box<int>" ,
1873+ " b.setValue(42)" ,
1874+ " if b.getValue() == 42 and b.prev == null" ,
1875+ " testSuccess()" ,
1876+ "endpackage"
1877+ );
1878+ }
1879+
18461880
18471881}
You can’t perform that action at this time.
0 commit comments