Show deprecation warning for fields of a deprecated enum (#10112)

* Show deprecation warning for fields of a deprecated enum

* Add test
This commit is contained in:
Neelesh Chandola
2018-12-30 14:15:39 +05:30
committed by Andreas Rumpf
parent c5ad4c10cb
commit cbbdcb2669
2 changed files with 22 additions and 7 deletions

View File

@@ -1,9 +1,19 @@
discard """
nimout: "a is deprecated [Deprecated]"
nimout: '''tdeprecated.nim(10, 3) Warning: a is deprecated [Deprecated]
tdeprecated.nim(17, 11) Warning: asdf; enum 'Foo' which contains field 'a' is deprecated [Deprecated]
'''
"""
block:
var
a {.deprecated.}: array[0..11, int]
var
a {.deprecated.}: array[0..11, int]
a[8] = 1
a[8] = 1
block t10111:
type
Foo {.deprecated: "asdf" .} = enum
a
var _ = a