mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 03:37:55 +00:00
fixes #25252
(cherry picked from commit d54b5f3ae1)
This commit is contained in:
@@ -375,7 +375,7 @@ template main {.dirty.} =
|
||||
type
|
||||
Color = enum
|
||||
Red, Blue, Yellow
|
||||
|
||||
|
||||
type
|
||||
ObjectVarint3 = object
|
||||
case kind: Color = Blue
|
||||
@@ -663,7 +663,7 @@ template main {.dirty.} =
|
||||
|
||||
when not(T is void):
|
||||
v.vResultPrivate
|
||||
|
||||
|
||||
type R = Result[int, string]
|
||||
|
||||
proc testAssignResult() =
|
||||
@@ -811,3 +811,17 @@ template main {.dirty.} =
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
type
|
||||
Thing = object
|
||||
a: int = 100 # this is fine
|
||||
b = 100 # this is not
|
||||
|
||||
proc overloaded[T: SomeSignedInt](x: T) = discard
|
||||
proc overloaded[T: SomeUnsignedInt](x: T) = discard
|
||||
proc overloaded[T: object](x: T) =
|
||||
for val in fields(x):
|
||||
var v: typeof(val)
|
||||
overloaded(v)
|
||||
|
||||
overloaded(Thing())
|
||||
|
||||
Reference in New Issue
Block a user