-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix boxing of generics in generic method and constructor calls + fix …
…constructor calls on generic classes
- Loading branch information
1 parent
3ae11ff
commit df2f4ce
Showing
6 changed files
with
97 additions
and
76 deletions.
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
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
20 changes: 20 additions & 0 deletions
20
ScriptingEngineTester/src/main/resources/zencode-tests/generics/generic-boxing.zc
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,20 @@ | ||
#output: Jimmy | ||
#output: 19 | ||
|
||
public class Duad<A, B> { | ||
public var a as A : get; | ||
public var b as B : get; | ||
public this(a as A, b as B) { | ||
this.a = a; | ||
this.b = b; | ||
} | ||
} | ||
|
||
public function duadExample(name as string, age as int) as Duad<string, int> { | ||
return new Duad<string, int>(name, age); | ||
} | ||
|
||
var jimmy = duadExample("Jimmy", 19); | ||
|
||
println(jimmy.a); | ||
println(jimmy.b); |
12 changes: 12 additions & 0 deletions
12
ScriptingEngineTester/src/main/resources/zencode-tests/maps/boxed-value-test.zc
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,12 @@ | ||
#output: 1 | ||
#output: test | ||
|
||
var item_values = {} as int[string]; | ||
item_values["box"] = 1; | ||
item_values["test"] = 9; | ||
println(item_values["box"]); | ||
|
||
var value_items = {} as string[int]; | ||
value_items[1] = "box"; | ||
value_items[9] = "test"; | ||
println(value_items[9]); |
58 changes: 0 additions & 58 deletions
58
.../org/openzen/zenscript/scriptingexample/tests/actual_test/java_native/AutoBoxingTest.java
This file was deleted.
Oops, something went wrong.