Skip to content
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

[Bug]: Can't Access Members of memberType in a Record from the Same Package #43619

Open
VellummyilumVinoth opened this issue Nov 20, 2024 · 0 comments
Labels
needTriage The issue has to be inspected and labeled manually Type/Bug userCategory/Compilation

Comments

@VellummyilumVinoth
Copy link

Description

When attempting to access the members of a memberType that is defined in the same package, using getTypeFromSymbol on the type information, the members of the memberType cannot be accessed.

Steps to Reproduce

1. Define a Record and the function

import ballerinax/health.fhir.r4.uscore501;

public function mapPatientToUsCore(Patient patient) returns uscore501:USCorePatientProfile => {
    identifier: [],
    gender: "unknown",
    name: []
};

public type Patient record {
    string patientType;
    string patientId;
};

2. Use function getTypeFromSymbol for the USCorePatientProfile

3. Access Members of the Extension Type

When attempting to retrieve members of the Extension type using getTypeFromSymbol, the members cannot be accessed.

The type info (USCorePatientProfile.USCorePatientProfileLink.Reference.Extension) returned appears as:

{
  "memberType": {
    "name": "Extension",
    "optional": false,
    "typeInfo": {
      "name": "Extension",
      "orgName": "ballerinax",
      "moduleName": "health.fhir.r4",
      "version": "5.2.0"
    },
    "defaultable": false,
    "isRestType": false
  },
  "name": "extension",
  "typeName": "array",
  "optional": true,
  "defaultable": false,
  "isRestType": false
}

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

@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needTriage The issue has to be inspected and labeled manually Type/Bug userCategory/Compilation
Projects
None yet
Development

No branches or pull requests

2 participants