Skip to content

Commit 39fe062

Browse files
committed
Fix failing test case in array typechecking
1 parent 3ccfb8d commit 39fe062

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/types/checker/__tests__/arrays.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const testcases: {
6565
numbers[0] = 10; // Correct assignment
6666
`,
6767
result: { type: null, errors: [] },
68+
only: true,
6869
},
6970
{
7071
input: `

src/types/types/nonPrimitives.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ export class Integer extends Class {
7373
public canBeAssigned(type: Type): boolean {
7474
return super.canBeAssigned(type) || type instanceof Primitives.Int;
7575
}
76+
77+
public equals(object: unknown): boolean {
78+
return object instanceof Integer;
79+
}
7680
}
7781

7882
export class Long extends Class {

0 commit comments

Comments
 (0)