fixes #9149 [backport]
This commit is contained in:
parent
a58f5b6023
commit
07a0a61875
2 changed files with 28 additions and 4 deletions
22
tests/overload/tconverter_to_string.nim
Normal file
22
tests/overload/tconverter_to_string.nim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
discard """
|
||||
output: '''123
|
||||
c is not nil'''
|
||||
"""
|
||||
|
||||
# bug #9149
|
||||
|
||||
type
|
||||
Container = ref object
|
||||
data: int
|
||||
|
||||
converter containerToString*(x: Container): string = $x.data
|
||||
|
||||
var c = Container(data: 123)
|
||||
var str = string c
|
||||
echo str
|
||||
|
||||
if c == nil: # this line can compile on v0.18, but not on 0.19
|
||||
echo "c is nil"
|
||||
|
||||
if not c.isNil:
|
||||
echo "c is not nil"
|
||||
Loading…
Add table
Add a link
Reference in a new issue