Working test cases for the sophisticated matrix library example from the manual
Fixed the dot operator when used within return types (see tgenericdotrettype) Fixed the matching of generic concepts aliases used with the implicit generics style
This commit is contained in:
parent
52b241fd57
commit
cbf66e99a8
12 changed files with 211 additions and 53 deletions
29
tests/generics/tgenericdotrettype.nim
Normal file
29
tests/generics/tgenericdotrettype.nim
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
discard """
|
||||
output: '''string
|
||||
int
|
||||
(int, string)
|
||||
'''
|
||||
"""
|
||||
|
||||
import typetraits
|
||||
|
||||
type
|
||||
Foo[T, U] = object
|
||||
x: T
|
||||
y: U
|
||||
|
||||
proc bar[T](a: T): T.U =
|
||||
echo result.type.name
|
||||
|
||||
proc bas(x: auto): x.T =
|
||||
echo result.type.name
|
||||
|
||||
proc baz(x: Foo): (Foo.T, x.U) =
|
||||
echo result.type.name
|
||||
|
||||
var
|
||||
f: Foo[int, string]
|
||||
x = bar f
|
||||
z = bas f
|
||||
y = baz f
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue