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

Constrained string types translate to a PrimitiveType without further info #43

Open
woppa684 opened this issue Sep 4, 2023 · 3 comments

Comments

@woppa684
Copy link

woppa684 commented Sep 4, 2023

The TypeScript implementation tries to decode this as a builtin type, but throws an error. It would be probably be best to just interpret such a type as a normal string for now.

{
    "children": [
    ],
    "concept": {
        "key": "PrimitiveType",
        "language": "LIonCore-M3",
        "version": "1"
    },
    "id": "NWQ4ZDZmZTUtODExZS00NTBhLWFhYjEtZjA2YzBkOWJhODk2LzU3NjkwMjQ5ODM1NjA4NjAxNzU",
    "parent": "NWQ4ZDZmZTUtODExZS00NTBhLWFhYjEtZjA2YzBkOWJhODk2",
    "properties": [
        {
            "property": {
                "key": "IKeyed-key",
                "language": "LIonCore-M3",
                "version": "1"
            },
            "value": "NWQ4ZDZmZTUtODExZS00NTBhLWFhYjEtZjA2YzBkOWJhODk2LzU3NjkwMjQ5ODM1NjA4NjAxNzU"
        },
        {
            "property": {
                "key": "LIonCore-builtins-INamed-name",
                "language": "LIonCore-builtins",
                "version": "1"
            },
            "value": null
        }
    ],
    "references": [
    ]
}
@enikao
Copy link
Contributor

enikao commented Sep 8, 2023

Does this relate to the MPS implementation or TypeScript? If the latter, please open a bug in https://github.com/LIonWeb-org/lioncore-typescript

@woppa684
Copy link
Author

woppa684 commented Sep 9, 2023

Not really I guess. It is not wise to map all non-builtin PrimiteTypes to string. On the MPS side you at least know that something is a constained string type, so it would be better to map that to string there.

@enikao
Copy link
Contributor

enikao commented Sep 11, 2023

Ok, now I get it. I've never seen a constrained string type in the wild, that's why I didn't think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants