From 35f0faf3451f1d72fe591a2546d84b80925f988e Mon Sep 17 00:00:00 2001 From: k-hara Date: Thu, 2 Apr 2015 21:24:58 +0900 Subject: [PATCH] fix Issue 8217 - static nested class can reference outer scope by template instantiation --- test/fail_compilation/fail8217.d | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/fail_compilation/fail8217.d diff --git a/test/fail_compilation/fail8217.d b/test/fail_compilation/fail8217.d new file mode 100644 index 000000000000..e74b7c35f2f9 --- /dev/null +++ b/test/fail_compilation/fail8217.d @@ -0,0 +1,25 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/fail8217.d(22): Error: this for foo needs to be type D not type fail8217.D.C +--- +*/ + +class D +{ + int x; + template bar() + { + int foo() + { + return x; + } + } + static class C + { + int foo() + { + return bar!().foo(); + } + } +}