diff options
Diffstat (limited to 'tests/iii/implicit-string-opt-in')
| -rw-r--r-- | tests/iii/implicit-string-opt-in/case.json | 15 | ||||
| -rw-r--r-- | tests/iii/implicit-string-opt-in/program.cps | 14 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/iii/implicit-string-opt-in/case.json b/tests/iii/implicit-string-opt-in/case.json new file mode 100644 index 0000000..8fae19d --- /dev/null +++ b/tests/iii/implicit-string-opt-in/case.json @@ -0,0 +1,15 @@ +{ + "compiler_args": [ + "-no-std" + ], + "errors": [ + { + "line": 13, + "reason": "Cannot implicitly convert C_STRING to STRING" + }, + { + "line": 14, + "reason": "STRING requires an IMPLICIT constructor NEW" + } + ] +} diff --git a/tests/iii/implicit-string-opt-in/program.cps b/tests/iii/implicit-string-opt-in/program.cps new file mode 100644 index 0000000..b5afccc --- /dev/null +++ b/tests/iii/implicit-string-opt-in/program.cps @@ -0,0 +1,14 @@ +CLASS STRING + Text : C_STRING + PROCEDURE NEW(Value : C_STRING) + Text <- Value + ENDPROCEDURE + FUNCTION C_STR() RETURNS C_STRING + RETURN Text + ENDFUNCTION +ENDCLASS +DECLARE Explicit : STRING("explicit") +OUTPUT Explicit +DECLARE Text : STRING +Text <- "requires opt-in" +OUTPUT "requires opt-in" |
