parent
d88f46df38
commit
8054be6e52
2 changed files with 24 additions and 0 deletions
|
|
@ -319,6 +319,8 @@ proc semConv(c: PContext, n: PNode; expectedType: PType = nil): PNode =
|
||||||
return evaluated
|
return evaluated
|
||||||
else:
|
else:
|
||||||
targetType = targetType.base
|
targetType = targetType.base
|
||||||
|
of tyAnything, tyUntyped, tyTyped:
|
||||||
|
localError(c.config, n.info, "illegal type conversion to '$1'" % typeToString(targetType))
|
||||||
else: discard
|
else: discard
|
||||||
|
|
||||||
maybeLiftType(targetType, c, n[0].info)
|
maybeLiftType(targetType, c, n[0].info)
|
||||||
|
|
|
||||||
22
tests/arc/t20588.nim
Normal file
22
tests/arc/t20588.nim
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
discard """
|
||||||
|
cmd: "nim check --warnings:off --hints:off $file"
|
||||||
|
errormsg: ""
|
||||||
|
nimout: '''
|
||||||
|
t20588.nim(20, 12) Error: illegal type conversion to 'auto'
|
||||||
|
t20588.nim(21, 14) Error: illegal type conversion to 'typed'
|
||||||
|
t20588.nim(22, 16) Error: illegal type conversion to 'untyped'
|
||||||
|
'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
discard 0.0.auto
|
||||||
|
discard typed("abc")
|
||||||
|
discard untyped(4)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue