parent
474dd98125
commit
64ffa17f0f
3 changed files with 11 additions and 2 deletions
|
|
@ -593,6 +593,9 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string =
|
||||||
of tyUncheckedArray:
|
of tyUncheckedArray:
|
||||||
result = "UncheckedArray[" & typeToString(t[0]) & ']'
|
result = "UncheckedArray[" & typeToString(t[0]) & ']'
|
||||||
of tySequence:
|
of tySequence:
|
||||||
|
if t.sym != nil and prefer != preferResolved:
|
||||||
|
result = t.sym.name.s
|
||||||
|
else:
|
||||||
result = "seq[" & typeToString(t[0]) & ']'
|
result = "seq[" & typeToString(t[0]) & ']'
|
||||||
of tyOpt:
|
of tyOpt:
|
||||||
result = "opt[" & typeToString(t[0]) & ']'
|
result = "opt[" & typeToString(t[0]) & ']'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ discard """
|
||||||
nimout: '''but expected one of:
|
nimout: '''but expected one of:
|
||||||
proc fun0[T1: int | float | object | array | seq](a1: T1; a2: int)
|
proc fun0[T1: int | float | object | array | seq](a1: T1; a2: int)
|
||||||
first type mismatch at position: 1
|
first type mismatch at position: 1
|
||||||
required type for a1: T1: int or float or object or array or seq[T]
|
required type for a1: T1: int or float or object or array or seq
|
||||||
but expression 'byte(1)' is of type: byte
|
but expression 'byte(1)' is of type: byte
|
||||||
|
|
||||||
expression: fun0(byte(1), 0)
|
expression: fun0(byte(1), 0)
|
||||||
|
|
|
||||||
6
tests/types/tillegalseqrecursion.nim
Normal file
6
tests/types/tillegalseqrecursion.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
discard """
|
||||||
|
errormsg: "illegal recursion in type 'CyclicSeq'"
|
||||||
|
"""
|
||||||
|
# issue #13715
|
||||||
|
type
|
||||||
|
CyclicSeq = seq[ref CyclicSeq]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue