diff options
Diffstat (limited to 'testsuite/fail_compilation')
6 files changed, 24 insertions, 10 deletions
diff --git a/testsuite/fail_compilation/generic_arity.elna b/testsuite/fail_compilation/generic_arity.elna index 645aded..3284a83 100644 --- a/testsuite/fail_compilation/generic_arity.elna +++ b/testsuite/fail_compilation/generic_arity.elna @@ -2,7 +2,7 @@ module type Stack#[T] = record - items: T + items: ^T end var diff --git a/testsuite/fail_compilation/generic_base_mismatch.elna b/testsuite/fail_compilation/generic_base_mismatch.elna index e361052..dd3bec7 100644 --- a/testsuite/fail_compilation/generic_base_mismatch.elna +++ b/testsuite/fail_compilation/generic_base_mismatch.elna @@ -8,17 +8,17 @@ type end List#[T] = record - head: T + head: ^T end Queue#[T] = record(List#[T]) - tail: T + tail: ^T end var - jobs: Queue#[^File] - wrong: ^List#[^Socket] + jobs: Queue#[File] + wrong: ^List#[Socket] begin - wrong := @jobs (* @Error Expected type '\^List#\[\^Socket\]', but got '\^Queue#\[\^File\]' *) + wrong := @jobs (* @Error Expected type '\^List#\[Socket\]', but got '\^Queue#\[File\]' *) end. diff --git a/testsuite/fail_compilation/generic_by_value.elna b/testsuite/fail_compilation/generic_by_value.elna new file mode 100644 index 0000000..778feca --- /dev/null +++ b/testsuite/fail_compilation/generic_by_value.elna @@ -0,0 +1,7 @@ +module + +proc foo#[T](x: T) (* @Error Opaque type 'T' cannot be used as a procedure parameter *) +begin +return + +end. diff --git a/testsuite/fail_compilation/generic_field_by_value.elna b/testsuite/fail_compilation/generic_field_by_value.elna new file mode 100644 index 0000000..66f9b46 --- /dev/null +++ b/testsuite/fail_compilation/generic_field_by_value.elna @@ -0,0 +1,8 @@ +module + +type + Cell#[T] = record + field: T (* @Error Opaque type 'T' cannot be used as a record field type *) + end + +end. diff --git a/testsuite/fail_compilation/generic_parameter_arithmetic.elna b/testsuite/fail_compilation/generic_parameter_arithmetic.elna index e05b1ee..9f6909d 100644 --- a/testsuite/fail_compilation/generic_parameter_arithmetic.elna +++ b/testsuite/fail_compilation/generic_parameter_arithmetic.elna @@ -1,9 +1,8 @@ module -proc walk#[T](value: T; step: ^T) +proc walk#[T](step: ^T) begin - step := step + 1; - value := value + 1 (* @Error Type parameter 'T' cannot be used in pointer arithmetic *) + step := step + 1 (* @Error Type parameter 'T' cannot be used in pointer arithmetic *) return end. diff --git a/testsuite/fail_compilation/generic_uninferrable.elna b/testsuite/fail_compilation/generic_uninferrable.elna index b3556d6..7eca7a9 100644 --- a/testsuite/fail_compilation/generic_uninferrable.elna +++ b/testsuite/fail_compilation/generic_uninferrable.elna @@ -2,7 +2,7 @@ program() var got: ^Word8 -proc allocate#[R](size: Word) -> R +proc allocate#[R](size: Word) -> ^R extern begin |
