ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[Question]: Service and Object have the same TypeTag

Open f-schnabel opened this issue 1 year ago • 2 comments
trafficstars

Description

I don't know if this is a bug or intended, but it seems quite strange that both Object and Service have the same TypeTag. I think it was forgotten to add the +1 to the definition of the service tag.

Relevant code: https://github.com/ballerina-platform/ballerina-lang/blob/74c7367c33644cb3464523349896622ac5221a5f/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/TypeTags.java#L60-L62

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

f-schnabel avatar Jul 03 '24 09:07 f-schnabel

Previously (pre-Swan Lake) objects and services used to be two separate things. However, with the current service design, services are just another kind of object, so the two being the same is intentional.

We could probably get rid of the service tag altogether though.

MaryamZi avatar Jul 03 '24 10:07 MaryamZi

Thank you for clarifying it. I also added this change to remove the Service TypeTag in one of my PRs where I found it. (#43035) Commit: https://github.com/ballerina-platform/ballerina-lang/pull/43035/commits/df7f0e782ee45a02058daa57095cabebdc51a48a

f-schnabel avatar Jul 03 '24 14:07 f-schnabel

Removing the service type tag may break the existing library compiler plugins, and they need some time to fix them. Therefore, I'd suggest if we are to remove the service type tag, do it before the next update release and provide some time for library owners to move.

ThisaruGuruge avatar Sep 11 '24 07:09 ThisaruGuruge