1 /* TEST_OUTPUT:
2 ---
3 Foo
4 Bar
5 ---
6 */
7 class Foo
8 {
opDispatch(string name)9     void opDispatch(string name)() { pragma(msg, "Foo"); }
10 }
11 class Bar
12 {
opDispatch(string name)13     void opDispatch(string name)() { pragma(msg, "Bar"); }
14 }
15 class Baz
16 {
17 }
18 
main()19 void main()
20 {
21     auto foo = new Foo;
22     auto bar = new Bar;
23     auto baz = new Baz;
24 
25     with (foo)
26     {
27         f0();
28         with (bar)
29         {
30             f1();
31         }
32         with (baz)
33         {
34             static assert(!__traits(compiles, f2()));
35         }
36     }
37 }
38