mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-20 07:51:32 +00:00
* fixes #21801; object field initialization with overloaded functions * use the correct type
This commit is contained in:
@@ -591,6 +591,29 @@ template main {.dirty.} =
|
||||
|
||||
mainSync()
|
||||
|
||||
block: # bug #21801
|
||||
func evaluate(i: int): float =
|
||||
0.0
|
||||
|
||||
func evaluate(): float =
|
||||
0.0
|
||||
|
||||
type SearchOptions = object
|
||||
evaluation: proc(): float = evaluate
|
||||
|
||||
block:
|
||||
func evaluate(): float =
|
||||
0.0
|
||||
|
||||
type SearchOptions = object
|
||||
evaluation: proc(): float = evaluate
|
||||
|
||||
block:
|
||||
func evaluate(i: int): float =
|
||||
0.0
|
||||
|
||||
type SearchOptions = object
|
||||
evaluation = evaluate
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user