Closed d-jeffery closed 1 month ago
If given a definition where the relation name and direct relation are the same word - the type is highlighted instead https://github.com/openfga/language/blob/main/pkg/js/util/exceptions.ts#L433
Test case:
- name: invalid type error maps to wrong location when duplicate relation name is used in direct assignment
dsl: |
model
schema 1.1
type custome
type bank
relations
define customer : [customer]
type account
relations
define owner : [customer]
expected_errors:
- msg: "`customer` is not a valid type."
line:
start: 5
end: 5
column:
start: 23
end: 31
metadata:
errorType: invalid-type
- msg: "`customer` is not a valid type."
line:
start: 8
end: 8
column:
start: 20
end: 28
metadata:
errorType: invalid-type
Found some validation errors when using the latest java build from main;
Incorrect highlight of definition name, instead of type reference;
All errors being assigned to first occurrence of type reference;