Hi team,
Currently, I'm trying to implement a class by including the Object type (interface) that is defined in another package. In other word, my interface is in separate package and my class implementation in a different package.
For example,
In package - A ( ballerinax/health.fhir.r4)
public type Finder readonly & object {
public isolated function addCodeSystems(CodeSystem[] codeSystems) returns error;
}
Here, the CodeSystem is record defined in the same packge (package - A)
In package - B
public readonly class FinderImpl {
*r4:Finder;
public isolated function addCodeSystems(r4:CodeSystem[] codeSystems) returns error {
// The further implementation
}
}
While doing this I getting the below error.
mismatched function signatures: expected 'public function addCodeSystems(ballerinax/health.fhir.r4:3.0.5:CodeSystem[] ) returns error', found 'public function addCodeSystems(ballerinax/health.fhir.r4:3.0.5:CodeSystem[] codeSystems) returns error'
Even though the method signatures are identical to each other, it returning this compile time error.
Note - These errors are occurring only if the method definitions have parameters.
For instance, in this (below) case there are no such issues.
type Person object {
string name;
function getName() returns string;
};
class Engineer {
*Person;
function getName() returns string {
return self.name;
}
}