Refactored contracts (#2960)

* - Properly support `@deprecated` as contract.
- Support deprecating enum values.
- Refactor contracts

* Always copy enum constants.

* Bugfix.
This commit is contained in:
Christoffer Lerno
2026-02-20 01:51:28 +01:00
committed by GitHub
parent 5a82f672b5
commit 7c81bb35ca
23 changed files with 521 additions and 564 deletions

View File

@@ -0,0 +1,15 @@
constdef Foo
{
<* @deprecated *>
ABC
}
<* @deprecated *>
Foo a;
fn int main()
{
Foo f = Foo.ABC; // #warning: 'ABC' is deprecated.
Foo b = a; // #warning: 'a' is deprecated.
return 0;
}