Open chiranSachintha opened 1 year ago
This relates to #35.
See specifically https://github.com/ballerina-platform/ballerina-spec/issues/35#issuecomment-1512357879
What this case shows is that we need to distinguish different kinds of usage for module-level types as well as functions.
We can say here that
foo
has a "construct" usage of FooRecord
FooRecord
has a "call" usage of foo
So we have a cycle, which should be a compile-time error.
Description: Need to clarify the following scenario. As per the specification, annotations and default values of a type are considered as parts of its typedesc.
In the given example, when generating the typedesc for
FooRecord
, it is necessary to evaluate thefoo
function. However, to evaluate thefoo
function, the typedesc ofFooRecord
is required.I need to verify whether this scenario is correct or not. If it is incorrect, will we give an error at runtime or compile time? The specification does not mention whether we need to give a cyclic error for this type of scenario during compile time.