-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Summary of Changes `@PythonCall` is a more general version of `@PythonName`. If `@PythonCall` is set, `@PythonName` gets ignored completely. We now show an error if both annotation are used together on a function.
- Loading branch information
1 parent
15114df
commit d22c446
Showing
8 changed files
with
69 additions
and
12 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
2 changes: 1 addition & 1 deletion
2
tests/resources/validation/builtins/annotations/pythonModule/error.sdstest
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,4 +1,4 @@ | ||
// $TEST$ info "The Python module is identical to the Safe-DS package, so the annotation call can be removed." | ||
»@PythonModule("tests.validation.builtins.annotations.pythonModule")« | ||
@»PythonModule«("tests.validation.builtins.annotations.pythonModule") | ||
|
||
package tests.validation.builtins.annotations.pythonModule |
4 changes: 2 additions & 2 deletions
4
tests/resources/validation/builtins/annotations/pythonModule/no error.sdstest
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,6 +1,6 @@ | ||
// $TEST$ no info "The Python module is identical to the Safe-DS package, so the annotation call can be removed." | ||
»@PythonModule("tests.validation.builtins.annotations.pythonModule.other")« | ||
@»PythonModule«("tests.validation.builtins.annotations.pythonModule.other") | ||
// $TEST$ no info "The Python module is identical to the Safe-DS package, so the annotation call can be removed." | ||
»@PythonModule("tests.validation.builtins.annotations.pythonModule")« | ||
@»PythonModule«("tests.validation.builtins.annotations.pythonModule") | ||
|
||
package tests.validation.builtins.annotations.pythonModule |
8 changes: 4 additions & 4 deletions
8
...ltins/annotations/pythonName/main.sdstest → ...me/identical to safe-ds name/main.sdstest
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,11 @@ | ||
package tests.validation.builtins.annotations.pythonName | ||
package tests.validation.builtins.annotations.pythonName.identicalToSafeDsName | ||
|
||
// $TEST$ info "The Python name is identical to the Safe-DS name, so the annotation call can be removed." | ||
»@PythonName("TestClass1")« | ||
@»PythonName«("TestClass1") | ||
class TestClass1 | ||
|
||
// $TEST$ no info "The Python name is identical to the Safe-DS name, so the annotation call can be removed." | ||
»@PythonName("Test_Class_2")« | ||
@»PythonName«("Test_Class_2") | ||
// $TEST$ no info "The Python name is identical to the Safe-DS name, so the annotation call can be removed." | ||
»@PythonName("TestClass2")« | ||
@»PythonName«("TestClass2") | ||
class TestClass2 |
2 changes: 1 addition & 1 deletion
2
...otations/pythonName/no annotation.sdstest → ...cal to safe-ds name/no annotation.sdstest
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,4 +1,4 @@ | ||
package tests.validation.builtins.annotations.pythonName | ||
package tests.validation.builtins.annotations.pythonName.identicalToSafeDsName | ||
|
||
// $TEST$ no info "The Python name is identical to the Safe-DS name, so the annotation call can be removed." | ||
class TestClass3 |
26 changes: 26 additions & 0 deletions
26
...lidation/builtins/annotations/pythonName/mutually exclusive with python call/main.sdstest
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,26 @@ | ||
package tests.validation.builtins.annotations.pythonName.mutuallyExclusiveWithPythonCall | ||
|
||
@PythonCall("myFunction1()") | ||
// $TEST$ error "A Python name must not be set if a Python call is set." | ||
@»PythonName«("my_function_1") | ||
// $TEST$ no error "A Python name must not be set if a Python call is set." | ||
@»PythonName«("my_function_1") | ||
fun myFunction1() | ||
|
||
// $TEST$ error "A Python name must not be set if a Python call is set." | ||
@»PythonName«("my_function_2") | ||
// $TEST$ no error "A Python name must not be set if a Python call is set." | ||
@»PythonName«("my_function_2") | ||
@PythonCall("myFunction2()") | ||
fun myFunction2() | ||
|
||
// $TEST$ no error "A Python name must not be set if a Python call is set." | ||
@»PythonName«("my_function_3") | ||
fun myFunction3() | ||
|
||
// $TEST$ no error "A Python name must not be set if a Python call is set." | ||
@»PythonName«("my_function_2") | ||
// $TEST$ no error "A Python name must not be set if a Python call is set." | ||
@»PythonName«("my_function_2") | ||
@PythonCall("myFunction2()") | ||
class MyClass() |