Skip to content

Commit 0b92c24

Browse files
authored
Merge pull request #738 from Kipper-Lang/733-bug-type-checking-with-typeof-directly-always-results-in-true-expressions-1
Fixed incorrect binding of parentheses in the Antlr4 grammar for `typeof(...)` expressions
2 parents 4677c1d + 899c946 commit 0b92c24

8 files changed

Lines changed: 464 additions & 401 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ To use development versions of Kipper download the
7979
matches the required type set by the declaration or parameter. ([#696](https://github.com/Kipper-Lang/Kipper/issues/696))
8080
- Fixed class members being accessible without the use of 'this' causing a runtime error. ([#721](https://github.com/Kipper-Lang/Kipper/issues/721))
8181
- Fixed class members not being allowed to use names already used in a parent scope.
82+
- Fixed incorrect parentheses binding for typeof expressions causing `typeof(...) === ...` checks always returning
83+
`true`. [#733](https://github.com/Kipper-Lang/Kipper/issues/733)
8284

8385
### Deprecated
8486

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ representative at an online or offline event.
5959
## Enforcement
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62-
reported to the community leaders responsible for enforcement at [dev@lklatzer.com]([mailto:dev@lklatzer.com](mailto:dev@lklatzer.com?subject=Kipper%20Community%20Issue%3A%20...))
62+
reported to the community leaders responsible for enforcement at [dev@lklatzer.com](mailto:dev@lklatzer.com?subject=Kipper%20Community%20Issue%3A%20...)
6363
All complaints will be reviewed and investigated promptly and fairly.
6464

6565
All community leaders are obligated to respect the privacy and security of the

kipper/core/KipperParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ incrementOrDecrementPostfixExpression
341341
;
342342

343343
typeofExpression
344-
: 'typeof' assignmentExpression
344+
: 'typeof' '(' assignmentExpression ')'
345345
;
346346

347347
unaryExpression

kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)