-
Notifications
You must be signed in to change notification settings - Fork 771
Open
Labels
Team/CompilerFEAll issues related to Language implementation and Compiler, this exclude run times.All issues related to Language implementation and Compiler, this exclude run times.Type/BugneedTriageThe issue has to be inspected and labeled manuallyThe issue has to be inspected and labeled manuallyuserCategory/Compilation
Description
Description
$title.
Steps to Reproduce
import ballerina/io;
type Foo distinct service object {
isolated function get() returns string|error;
};
type Bar distinct service object {
};
public class Listener {
public function 'start() returns error? {
}
public function gracefulStop() returns error? {
}
public function immediateStop() returns error? {
}
public function detach(Foo|Bar s) returns error? {
}
public function attach(Foo|Bar s, string[]|string|() name = ()) returns error? {
io:println(s is Foo);
io:println(s is Bar);
io:println(s is Foo|Bar);
}
}
service on new Listener() {
isolated function get() returns string|error {
return "";
}
}
All the is checks evaluate to false. This particular example should probably fail at compile-time due to ambiguity anyway.
But, even for the following types, prints false for both.
type Foo distinct service object {
isolated function get() returns string|error;
};
type Bar distinct service object {
isolated function get() returns int|error;
};
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
Metadata
Metadata
Assignees
Labels
Team/CompilerFEAll issues related to Language implementation and Compiler, this exclude run times.All issues related to Language implementation and Compiler, this exclude run times.Type/BugneedTriageThe issue has to be inspected and labeled manuallyThe issue has to be inspected and labeled manuallyuserCategory/Compilation