disallow typedesc in arrays & move existing checks to types.typeAllowedAux (#13261)
* disallow typedesc in arrays and move previous checks to types.typeAllowedAux
This commit is contained in:
parent
579456d520
commit
4c08e64e98
12 changed files with 70 additions and 50 deletions
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
errormsg: "cannot assign macro 'm' to 'x1'. Did you mean to call the macro with '()'?"
|
||||
errormsg: "invalid type: 'macro (body: untyped): untyped{.noSideEffect, gcsafe, locks: 0.}' for let. Did you mean to call the macro with '()'?"
|
||||
line: 9
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
errormsg: "cannot assign macro 'm' to 'x2'. Did you mean to call the macro with '()'?"
|
||||
errormsg: "invalid type: 'macro (body: untyped): untyped{.noSideEffect, gcsafe, locks: 0.}' for const. Did you mean to call the macro with '()'?"
|
||||
line: 9
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
discard """
|
||||
cmd: "nim check $file"
|
||||
errormsg: "cannot assign template 'z' to 'y'. Did you mean to call the template with '()'?"
|
||||
errormsg: "invalid type: 'template (args: varargs[string])' for var. Did you mean to call the template with '()'?"
|
||||
nimout: '''
|
||||
t12844.nim(11, 11) Error: cannot assign template 'z' to 'x'. Did you mean to call the template with '()'?
|
||||
t12844.nim(12, 9) Error: cannot assign template 'z' to 'y'. Did you mean to call the template with '()'?'''
|
||||
t12844.nim(11, 7) Error: invalid type: 'template (args: varargs[string])' for const. Did you mean to call the template with '()'?
|
||||
t12844.nim(12, 5) Error: invalid type: 'template (args: varargs[string])' for var. Did you mean to call the template with '()'?'''
|
||||
"""
|
||||
|
||||
template z*(args: varargs[string, `$`]) =
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
errormsg: "invalid type for const: seq[SomeRefObj]"
|
||||
errormsg: "invalid type: 'SomeRefObj' in this context: 'seq[SomeRefObj]' for const"
|
||||
line: 14
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
errmsg: "'typedesc' metatype is not valid here; typed '=' instead of ':'?"
|
||||
errmsg: "invalid type: 'type int' for const"
|
||||
"""
|
||||
## issue #8610
|
||||
const Foo = int
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ cmd: "nim check $file"
|
|||
errmsg: ""
|
||||
nimout: '''
|
||||
ttypeAllowed.nim(13, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for let
|
||||
ttypeAllowed.nim(17, 7) Error: invalid type for const: iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}
|
||||
ttypeAllowed.nim(17, 7) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for const
|
||||
ttypeAllowed.nim(21, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for var
|
||||
ttypeAllowed.nim(26, 10) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for result
|
||||
'''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue