Skip to content

Commit

Permalink
add new future
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
  • Loading branch information
jabraham17 committed Oct 14, 2024
1 parent 0e1d4b0 commit e5cba67
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/functions/ferguson/spec-insn-type-method-no-this.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spec-insn-type-method-no-this.chpl:11: In method 'bar':
spec-insn-type-method-no-this.chpl:12: error: 't' used before defined
spec-insn-type-method-no-this.chpl:22: note: defined here
25 changes: 25 additions & 0 deletions test/functions/ferguson/spec-insn-type-method-no-this.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// similar to spec-insn-method-no-this.chpl, but with type methods
record R {
type t;
}

proc type (R(int)).foo() {
type tmp = this.t;
writeln("in specific R(int).foo, x=", tmp:string);
}

proc type (R(int)).bar() {
type tmp = t; // as above, t refers to field, `this` is implicit
writeln("in specific R(int).bar, x=", tmp:string);
}

proc getR type do return R(int);
proc type getR.baz() {
type tmp = t; // as above, t refers to field, `this` is implicit
writeln("in specific R(int).baz, x=", tmp:string);
}

type t = R(int);
t.foo();
t.bar();
t.baz();
6 changes: 6 additions & 0 deletions test/functions/ferguson/spec-insn-type-method-no-this.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bug: implicit this not working for type method on specific instantiation
#26083

Field and method accesses get an implicit `this` added during scopeResolve, but
for specific instantiations, scopeResolve does not do its usual work because
the type of `this` is not known until functionResolution.
3 changes: 3 additions & 0 deletions test/functions/ferguson/spec-insn-type-method-no-this.good
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
in specific R(int).foo, x=int(64)
in specific R(int).bar, x=int(64)
in specific R(int).baz, x=int(64)

0 comments on commit e5cba67

Please sign in to comment.