mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 12:04:44 +00:00
* fixes #20900; Calling template through from generic function across module fails to build
* sanother way
(cherry picked from commit 16f42084d3)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
type
|
||||
Noice* = object
|
||||
hidden: int
|
||||
|
||||
|
||||
template jjj*: Noice =
|
||||
Noice(hidden: 15)
|
||||
Noice(hidden: 15)
|
||||
|
||||
type Opt* = object
|
||||
o: int
|
||||
|
||||
template none*(O: type Opt): Opt = Opt(o: 0)
|
||||
|
||||
@@ -7,3 +7,7 @@ proc someGeneric(_: type) =
|
||||
doAssert $jjj() == "(hidden: 15)" # fails: "Error: the field 'hidden' is not accessible."
|
||||
|
||||
someGeneric(int)
|
||||
|
||||
# bug #20900
|
||||
proc c(y: int | int, w: Opt = Opt.none) = discard
|
||||
c(0)
|
||||
|
||||
Reference in New Issue
Block a user