summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorNeelesh Chandola <neelesh.chandola@outlook.com>2018-12-30 14:15:39 +0530
committerAndreas Rumpf <rumpf_a@web.de>2018-12-30 09:45:39 +0100
commitcbbdcb266962df39bbdacb99ccd2a656ce9c3af7 (patch)
treed56c646ee7d1ab0f29ae587234c8735a986a1042 /tests
parentc5ad4c10cb976960a37656a55ad2fdbb0add8861 (diff)
downloadNim-cbbdcb266962df39bbdacb99ccd2a656ce9c3af7.tar.gz
Show deprecation warning for fields of a deprecated enum (#10112)
* Show deprecation warning for fields of a deprecated enum

* Add test
Diffstat (limited to 'tests')
-rw-r--r--tests/deprecated/tdeprecated.nim18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/deprecated/tdeprecated.nim b/tests/deprecated/tdeprecated.nim
index 955a7f6ad..920f350cc 100644
--- a/tests/deprecated/tdeprecated.nim
+++ b/tests/deprecated/tdeprecated.nim
@@ -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
+