-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2695c3f
commit c460438
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
tests/endToEnd/runWithOutput/inputs/accessOnExpressions/main.ph
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,31 @@ | ||
import Standard.Io; | ||
import AccessOnExpressions.MyClass; | ||
|
||
module AccessOnExpressions.Main; | ||
|
||
function main () | ||
{ | ||
let variable myClass := new MyClass(); | ||
|
||
let myField := myClass.getField(); | ||
Io.writeLine(myField); | ||
|
||
Io.writeLine(myClass.getField()); | ||
|
||
myClass.setField('setField'); | ||
Io.writeLine(myClass.getField()); | ||
|
||
myClass := new MyClass(); | ||
|
||
let myFieldB := returnClass(myClass).getField(); | ||
Io.writeLine(myFieldB); | ||
|
||
returnClass(myClass).setField('setField'); | ||
Io.writeLine(returnClass(myClass).getField()); | ||
} | ||
|
||
function returnClass (myClass: MyClass): MyClass | ||
{ | ||
return myClass; | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
tests/endToEnd/runWithOutput/inputs/accessOnExpressions/myClass.ph
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,13 @@ | ||
class AccessOnExpressions.MyClass; | ||
|
||
field variable myField: String := 'myField'; | ||
|
||
method getField (): String | ||
{ | ||
return myField; | ||
} | ||
|
||
method setField (value: String) | ||
{ | ||
myField := value; | ||
} |
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,5 @@ | ||
myField | ||
myField | ||
setField | ||
myField | ||
setField |