Remove complex and compound constants.

This is not supported by the code generation, so it's a bit of a lie
  to have them in the language in the first place. There's arguably not
  even any use for constant records, list and tuples to begin with. So
  this cleans this up everywhere for the sake of moving forward with the
  alpha release.

  This now reduces constants to:

  - Integer
  - ByteArray
  - String

  Anything else can be declared via a function anyway. We can revisit
  this choice later.... or not.
This commit is contained in:
KtorZ
2023-02-17 17:30:24 +01:00
parent 560c17d5aa
commit cd4ceb219c
9 changed files with 81 additions and 618 deletions

View File

@@ -1,15 +1,17 @@
type Foo {
foo: Int,
const int_constant = 42
test int() {
int_constant == 42
}
const foo_constant = Foo { foo: 42 }
const bytearray_constant = #"abcd"
test foo() {
foo_constant == Foo { foo: 42 }
test bytearray() {
bytearray_constant == #"abcd"
}
const tuple_constant = (1, 2, 3)
const string_constant = "FOO"
test bar() {
tuple_constant == (1, 2, 3)
test string() {
string_constant == "FOO"
}