-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should standard library service
types be distinct
#2398
Comments
@jclark we would like to get your suggestion on this. |
If your service object types are currently defined as empty (without any members), then I think adding |
Actually, there is a slight mistake in the original description. When a service type is marked as distinct, it actually impacts the service declaration. You have to explicitly mention the service type as below. Therefore, we decided not to make services distinct. service MyService / on ll {
} Without service / on ll {
} |
@shafreenAnfar I don't think that's a spec requirement (if it is, it shouldn't be). |
This is a spec deviation in inferring the static type of the service declaration. |
As per the discussion we have update the standard library services. |
At the moment all the standard library service type definitions looks as follows,
which results in the below usages,
With service declaration
Without service declaration
To ensure the structure of the service (MyService) complier plugin is engaged during the compile time.
However, if we make the service type definition
distinct
, the usage would be as follows.With service declaration
No change in the usage.
Without service declaration
To ensure the structure of the service (MyService) complier plugin is engaged during the compile time.
However, in this case,
MyService
is a subtype ofSomeService
.MyService
from the rest of the services in a given program.Therefore, even though this is not a situation where we interop with a nominal type systems like Java or GraphQL, would it be a good idea to mark all the standard library services with
distinct
for SwanLake ?The text was updated successfully, but these errors were encountered: