Skip to content

Commit

Permalink
Fixes #190; Missing context type hint for an element access argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotVU committed Jul 22, 2024
1 parent 5dfb94a commit 56ac8b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/src/UC/expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ export class UCElementAccessExpression extends UCExpression {
const type = this.expression.getType();
if (type) {
this.accessType = resolveElementType(type);
info = {
contextType: this.accessType
};
}

this.argument?.index(document, context, info);
Expand Down
3 changes: 3 additions & 0 deletions server/src/UC/test/enum/EnumTest.uc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ function EEnumTest ShouldHintEnumTest()
AcceptByte(EEnumTest.EnumCount);
AcceptInt(ET_Other);

// in element accesses
MyEnumArrayPropertyTest[ET_Other] = ET_Other;

// in returns
return ET_Max;
}
Expand Down

0 comments on commit 56ac8b6

Please sign in to comment.