-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
353e917
commit 7b6fa45
Showing
11 changed files
with
46 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
//import "std/type/int" as unused; | ||
//import "os-test2" as s1; | ||
|
||
f<double> calledFunction(int mandatoryArg, dyn optionalArg = true) { | ||
printf("Mandatory: %d\n", mandatoryArg); | ||
printf("Optional: %d\n", optionalArg); | ||
return 0.1; | ||
} | ||
|
||
f<double> calledFunction(string testString) { | ||
printf("String: %s", testString); | ||
return 0.3; | ||
} | ||
import "os-test2" as s1; | ||
|
||
f<int> main() { | ||
dyn res = calledFunction(1, false); | ||
printf("Result: %f\n", res); | ||
calledFunction("test"); | ||
dyn v = s1::Vector<int>{}; | ||
v.setData(12); | ||
printf("Data: %d\n", v.data); | ||
v.setData(1.5); | ||
printf("Data: %d\n", v.data); | ||
} |
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
public type Vector1 struct { | ||
public int i2 | ||
} | ||
type T int|double; | ||
|
||
public type Vector struct { | ||
public Vector1 i1 | ||
public type Vector<T> struct { | ||
public T data | ||
} | ||
|
||
public p Vector1.ctor() { | ||
|
||
public p Vector.setData<T>(T data) { | ||
this.data = data; | ||
} |
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
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
2 changes: 1 addition & 1 deletion
2
test/test-files/typechecker/generics/error-failing-type-condition/exception.out
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[Error|Semantic] ./test-files/typechecker/generics/error-failing-type-condition/source.spice:8:16: | ||
Referenced undefined function: Function/Procedure 'max(short,short)' could not be found | ||
Referenced undefined function: Function/procedure 'max(short,short)' could not be found | ||
|
||
8 dyn test = max(1s, 2s); | ||
^^^^^^^^^^^ |
5 changes: 0 additions & 5 deletions
5
test/test-files/typechecker/generics/error-generic-function-not-found/exception.out
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
test/test-files/typechecker/generics/error-generic-method-not-found/exception.out
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,5 @@ | ||
[Error|Semantic] ./test-files/typechecker/generics/error-generic-method-not-found/source.spice:7:5: | ||
Referenced undefined function: Function/procedure 's1::Vector.setData(double)' could not be found | ||
|
||
7 v.setData(1.5); | ||
^^^^^^^^^^^^^^ |
File renamed without changes.
File renamed without changes.