summary refs log tree commit diff stats
path: root/tests/errmsgs/tsubscriptmismatch_legacy.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errmsgs/tsubscriptmismatch_legacy.nim')
-rw-r--r--tests/errmsgs/tsubscriptmismatch_legacy.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/errmsgs/tsubscriptmismatch_legacy.nim b/tests/errmsgs/tsubscriptmismatch_legacy.nim
new file mode 100644
index 000000000..3e1f1eb71
--- /dev/null
+++ b/tests/errmsgs/tsubscriptmismatch_legacy.nim
@@ -0,0 +1,10 @@
+discard """
+  nimout: '''
+  but expression 'x' is of type: Foo
+'''
+"""
+
+type Foo = object
+let x = Foo()
+discard x[1] #[tt.Error
+         ^ type mismatch: got <Foo, int literal(1)>]#