mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
@@ -286,6 +286,8 @@ proc semConv(c: PContext, n: PNode): PNode =
|
||||
return evaluated
|
||||
else:
|
||||
targetType = targetType.base
|
||||
of tyAnything, tyUntyped, tyTyped:
|
||||
localError(c.config, n.info, "illegal type conversion to '$1'" % typeToString(targetType))
|
||||
else: discard
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user