issue-#38 report passing receiver parameter IN to VAR

Locked

Should we merge the changes of branch issue-#38 into master?

Yes
6
86%
No
0
No votes
Abstain
1
14%
 
Total votes: 7

User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#38 report passing receiver parameter IN to VAR

Post by Josef Templ »

This voting is for merging the changes of topic branch issue-#38
(report passing receiver parameter IN to VAR) into master.
See http://redmine.blackboxframework.org/issues/38.
See the diffs in http://redmine.blackboxframework.org/pr ... 947950a7ed.

This fix closes a loophole in the type checking of the compiler.
In BB1.6 it was allowed to pass an actual IN parameter to a formal VAR parameter if
the parameter is the receiver of a method (type bound procedure).
For all other parameters this is not allowed. With the change, it is now also marked as
an error by the compiler. Since this bug was used in several places in the BB distribution
several files had to be adapted, too. The most prominent example is module Meta
which needed a change of the receiver parameter from VAR to IN for the methods of Meta.Item.
For the user, there is no change unless the type checking loophole is used in the user's code.
In such a case the compiler clearly marks the problem and it is simple to fix it.

The changes are as proposed in CPC 1.7 rc5 plus an adaptation in the docu of
module Meta.

Gentlemen, please cast your votes

- Josef
Locked