File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ pub fn generate(tests_file: &mut File) {
4848 ( "binary/" , "tuples" ) ,
4949 ( "binary/" , "err_class" ) ,
5050
51+ ( "binder/" , "sneaky" ) ,
52+
5153 ( "cyclic/" , "class_members_and_fun_thru_param" ) ,
5254 ( "cyclic/" , "err_class_members_and_fun_thru_param" ) ,
5355 ( "cyclic/" , "class_members_and_fun_thru_param_nocycle" ) ,
Original file line number Diff line number Diff line change 1+ // This test case is to make sure we don't try to have the Binder assign
2+ // Sneaker.sneak() to the call to sneaky.sneak() in do_sneak().
3+ //
4+ // In particular, the Binder should essentially never even attempt to handle
5+ // name resolution on an identifier bound to an expression with a dot.
6+
7+ class Sneaky {
8+ fun sneak() {
9+ print("I'm sneaky!");
10+ }
11+ }
12+
13+ class Sneaker {
14+ fun sneak() {
15+ print("I'm a sneaker!");
16+ }
17+
18+ var sneaky = new Sneaky{};
19+
20+ fun do_sneak() {
21+ sneaky.sneak();
22+ }
23+ }
24+
25+ fun init() {
26+ var s = new Sneaker{};
27+ s.do_sneak(); //! I'm sneaky!
28+ }
You can’t perform that action at this time.
0 commit comments