mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
Fixes two line infos to make the error's clearer inside editors - 'field is not accessible' would point to the whole object construction instead of just the field inside the construction - 'field initialized twice' would point to the colon instead of the field
24 lines
334 B
Nim
24 lines
334 B
Nim
discard """
|
|
cmd: "nim check $file"
|
|
"""
|
|
|
|
import mobjconstr_msgs
|
|
|
|
|
|
block:
|
|
discard PrivateField(
|
|
priv: "test" #[tt.Error
|
|
^ the field 'priv' is not accessible]#
|
|
)
|
|
|
|
|
|
block:
|
|
type
|
|
Foo = object
|
|
field: string
|
|
discard Foo(
|
|
field: "test",
|
|
field: "test" #[tt.Error
|
|
^ field initialized twice: 'field']#
|
|
)
|