forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
- Loading branch information
1 parent
0e1d4b0
commit e5cba67
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
test/functions/ferguson/spec-insn-type-method-no-this.chpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |