mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
Because `prevFields` and `currentFields` have been already quoted by `'`, no need to add another. The error message was ``` The fields ''x'' and ''y'' cannot be initialized together, because they are from conflicting branches in the case object. ```
16 lines
273 B
Nim
16 lines
273 B
Nim
discard """
|
|
errormsg: '''
|
|
The fields 'x' and 'y' cannot be initialized together, because they are from conflicting branches in the case object.
|
|
'''
|
|
"""
|
|
|
|
type
|
|
Foo = object
|
|
case kind: bool
|
|
of true:
|
|
x: int
|
|
of false:
|
|
y: int
|
|
|
|
|
|
var f = Foo(x: 1, y: 1) |