added the 'x.p[:T]' notation for explicit generic instantiations in combination with the ddot calling syntax
This commit is contained in:
parent
651c0e45da
commit
212fdc5946
9 changed files with 81 additions and 53 deletions
|
|
@ -1,6 +1,7 @@
|
|||
discard """
|
||||
output: '''holla
|
||||
true'''
|
||||
true
|
||||
defabc 4'''
|
||||
"""
|
||||
|
||||
# Test top level semicolon works properly:
|
||||
|
|
@ -13,3 +14,8 @@ proc `\*` (x, y: int): int = result = x * y
|
|||
|
||||
echo 5 \+ 1 \* 9 == 6*9
|
||||
|
||||
proc foo[S, T](x: S, y: T): T = x & y
|
||||
|
||||
proc bar[T](x: T): T = x
|
||||
|
||||
echo "def".foo[:string, string]("abc"), " ", 4.bar[:int]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue