mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Refactored contracts (#2960)
* - Properly support `@deprecated` as contract. - Support deprecating enum values. - Refactor contracts * Always copy enum constants. * Bugfix.
This commit is contained in:
committed by
GitHub
parent
5a82f672b5
commit
7c81bb35ca
15
test/test_suite/contracts/contract_deprecation.c3
Normal file
15
test/test_suite/contracts/contract_deprecation.c3
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user