Skip to content

Commit dc2cafc

Browse files
sylvainlaurentsnicoll
authored andcommitted
Fix class literal in instanceof
Closes gh-1151
1 parent 49fc492 commit dc2cafc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/asciidoc/core-expressions.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ expression based `matches` operator.
785785
----
786786
// evaluates to false
787787
boolean falseValue = parser.parseExpression(
788-
"'xyz' instanceof T(Integer.class)").getValue(Boolean.class);
788+
"'xyz' instanceof T(Integer)").getValue(Boolean.class);
789789
790790
// evaluates to true
791791
boolean trueValue = parser.parseExpression(
@@ -799,7 +799,7 @@ expression based `matches` operator.
799799
[NOTE]
800800
====
801801
Be careful with primitive types as they are immediately boxed up to the wrapper type,
802-
so `1 instanceof T(int)` evaluates to `false` while `1 instanceof T(Integer.class)`
802+
so `1 instanceof T(int)` evaluates to `false` while `1 instanceof T(Integer)`
803803
evaluates to `true`, as expected.
804804
====
805805

0 commit comments

Comments
 (0)