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

Leading dot notation should not appear in insert shapes #4958

Closed
zchenb opened this issue Jan 31, 2023 · 2 comments · Fixed by #5142
Closed

Leading dot notation should not appear in insert shapes #4958

zchenb opened this issue Jan 31, 2023 · 2 comments · Fixed by #5142
Assignees
Labels

Comments

@zchenb
Copy link
Contributor

zchenb commented Jan 31, 2023

The following query should not be compiled and executed successfully:

insert Person {name := "<name>", friends := .friends};
@zchenb
Copy link
Contributor Author

zchenb commented Mar 9, 2023

This seems fine:

insert Person {name := "t1", dname := .name};

So not really a issue?

It may also be used in the case of schema computables.

@zchenb
Copy link
Contributor Author

zchenb commented Apr 12, 2023

Another interesting case:

Schema:

type Test2 {
    d1 : str ;
    d2 : str {
        default := "d2" ;
    }
    d3 : str {
        default := .d2
    }
    d4 : str {
        default := .d3
    }
    d5 : str {
        default := .d4
    }
}

Query:

insert Test2 { d1 := "6", d3 := "fe", d5 := .d2};
insert Test2 { d1 := "7"};
insert Test2 { d1 := "8", d3 := "fe"};

Result:

default::Test2 {id: 4c64eec6-d96c-11ed-be7f-77285a6a60ff, d1: '6', d2: 'd2', d4: 'fe', d3: 'fe', d5: {}},
default::Test2 {id: c786c4e4-d96c-11ed-afc5-ff76c51d0376, d1: '7', d2: 'd2', d4: 'd2', d3: 'd2', d5: 'd2'},
default::Test2 {id: e41bb7ae-d96c-11ed-afc5-673d47b6bf08, d1: '8', d2: 'd2', d4: 'fe', d3: 'fe', d5: 'fe'},

Does not make any sense to me how d5 could possibly be {}

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

Successfully merging a pull request may close this issue.

1 participant