Skip to content

Commit e7f8957

Browse files
authored
fix(tolk/types): fix type compatibility for boolean types (#5)
1 parent ec746af commit e7f8957

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.1.1] - 07.07.2025
6+
7+
Fix bug with type compatibility, this inspection is disabled by default for now.
8+
59
## [0.1.0] - 07.07.2025
610

711
First stable version

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"BoC",
1313
"TL-B"
1414
],
15-
"version": "0.1.0",
15+
"version": "0.1.1",
1616
"engines": {
1717
"vscode": "^1.63.0"
1818
},
@@ -399,7 +399,9 @@
399399
"cannot-reassign"
400400
]
401401
},
402-
"default": [],
402+
"default": [
403+
"type-compatibility"
404+
],
403405
"description": "List of disabled code inspections. All inspections are enabled by default."
404406
}
405407
}

package.server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ton-language-server",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Language Server for the TON Blockchain",
55
"main": "server.js",
66
"keywords": [

server/src/languages/tolk/types/ty.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,18 @@ export class BoolTy extends NonNamedTy {
624624
return BoolTy.TRUE
625625
}
626626

627+
public override equals(other: Ty): boolean {
628+
if (other instanceof BoolTy) {
629+
return this.value === other.value
630+
}
631+
return false
632+
}
633+
634+
public override canRhsBeAssigned(other: Ty): boolean {
635+
if (other instanceof BoolTy) return true
636+
return super.canRhsBeAssigned(other)
637+
}
638+
627639
public static BOOL: BoolTy = new BoolTy(undefined)
628640
public static TRUE: BoolTy = new BoolTy(true)
629641
public static FALSE: BoolTy = new BoolTy(false)

0 commit comments

Comments
 (0)