mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
fixes #22753 ## Future work We should turn all the error nodes into nodes of a nkError kind, which could be a industrious task. But perhaps we can add a special treatment for error nodes to make the transition smooth.
17 lines
332 B
Nim
17 lines
332 B
Nim
discard """
|
|
cmd: "nim check $file"
|
|
"""
|
|
|
|
type
|
|
Test[T, K] = object
|
|
name: string
|
|
Something = Test[int]
|
|
|
|
func `[]`[T, K](x: var Test[T, K], idx: int): var Test[T, K] =
|
|
x
|
|
|
|
var b: Something
|
|
# Should give an error since Something isn't a valid Test
|
|
b[0].name = "Test" #[tt.Error
|
|
^ expression '' has no type (or is ambiguous)]#
|