Skip to content

Commit 1fc58ea

Browse files
authored
Merge pull request #289 from dotnet/dev/jorobich/add-cast-test
2 parents b75bcbf + 8c1d843 commit 1fc58ea

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/expressions.tests.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,35 @@ var x = new // comment
16691669
]);
16701670
});
16711671

1672+
it("cast of invocation", async () => {
1673+
const input = Input.InMethod(`
1674+
(int)y.M();
1675+
(int) y.M();
1676+
`);
1677+
const tokens = await tokenize(input);
1678+
1679+
tokens.should.deep.equal([
1680+
Token.Punctuation.OpenParen,
1681+
Token.PrimitiveType.Int,
1682+
Token.Punctuation.CloseParen,
1683+
Token.Variable.Object("y"),
1684+
Token.Punctuation.Accessor,
1685+
Token.Identifier.MethodName("M"),
1686+
Token.Punctuation.OpenParen,
1687+
Token.Punctuation.CloseParen,
1688+
Token.Punctuation.Semicolon,
1689+
Token.Punctuation.OpenParen,
1690+
Token.PrimitiveType.Int,
1691+
Token.Punctuation.CloseParen,
1692+
Token.Variable.Object("y"),
1693+
Token.Punctuation.Accessor,
1694+
Token.Identifier.MethodName("M"),
1695+
Token.Punctuation.OpenParen,
1696+
Token.Punctuation.CloseParen,
1697+
Token.Punctuation.Semicolon,
1698+
]);
1699+
});
1700+
16721701
it("as cast of identifier", async () => {
16731702
const input = Input.InMethod(`var x = o as List<Lazy<string>>;`);
16741703
const tokens = await tokenize(input);

0 commit comments

Comments
 (0)