# Plan to change the convention of passed "Normal Parameters" from +1 to +0

**URL:** <https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779>\
**Category:** Compiler\
**Created:** [March 9, 2018, 9:28pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779 "2018-03-09T21:28:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Gottesman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_gottesman/32/280_2.png) [@Michael\_Gottesman](https://forums.swift.org/u/Michael_Gottesman)\
**Post date:** [March 9, 2018, 9:28pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/1 "2018-03-09T21:28:32Z")

</div>

I am currently preparing to implement [Proposal to change the default ownership for passing parameters - #28 by Chris\_Lattner3](https://forums.swift.org/t/proposal-to-change-the-default-ownership-for-passing-parameters/10261/28) and enable the convention change on master. I have been thinking about the least disruptive way to do this transition since  
it is a big one. The main minimization points I thought about were build  
breakage and impact on other developers. With that in mind my goals are:

1. To other developers, there should be minimal impact on their workflow. That  
means making the disruption time as small as possible.
2. The build should be repairable without having to churn the tests. There needs  
to be a simple, small commit that can undo this in case of crazy breakage.

With that in mind here is the plan:

1. I am going to commit all of the changed tests with a prefix of some  
sort. These will not run when normal people are developing since they will be  
protected by the plus\_zero\_runtime lit feature. In addition, I will update  
the non-prefixed tests to be guarded by the plus\_one\_runtime lit  
feature. This is important since otherwise, I can not make a small revert  
without touching those 200 tests.

2. On my branch (#14953), I am going to keep the updated tests in both positions  
(with and without the prefix). This will let me as people change tests to be  
able to still detect conflicts. I have written some scripting that takes the  
current tests in that branch, copies them into their PREFIX form on  
master. So I can continue to update these tests without any impacts on other  
people.

3. Once everything is ready, I should be able to do a small commit that flips  
the switch everywhere. At this point, other developers will have an impact  
namely that they need to update the ~200 plus zero tests instead of the  
normal tests. I imagine that this will only be so that we can do a quick  
revert if there are problems and will not last more than a couple of days if  
not less.

4. Once this is done and all the dust has settled, then we just move over the  
plus zero tests to their new home.

### Time Table

The time table for this work is:

1. 3/9-3/11. I would like to get to stage 3 by this weekend.
2. 3/12-3/15. I am going to fix any issues that come up over the week.
3. 3/16-3/18. Sometime over next weekend, I would like to do stage 4.

I will post to this thread when I perform each one of these individual tasks.

---

<div class="post-metadata">

**Author:** ![Michael\_Gottesman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_gottesman/32/280_2.png) [@Michael\_Gottesman](https://forums.swift.org/u/Michael_Gottesman)\
**Post date:** [March 9, 2018, 9:29pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/2 "2018-03-09T21:29:42Z")

</div>

Please post any questions/concerns here as well.

---

<div class="post-metadata">

**Author:** ![Erik\_Eckstein](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/erik_eckstein/32/320_2.png) [@Erik\_Eckstein](https://forums.swift.org/u/Erik_Eckstein)\
**Post date:** [March 9, 2018, 9:32pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/3 "2018-03-09T21:32:36Z")

</div>

Sounds good to me

---

<div class="post-metadata">

**Author:** ![dabrahams](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dabrahams/32/9815_2.png) [@dabrahams](https://forums.swift.org/u/dabrahams)\
**Post date:** [March 10, 2018, 6:00am UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/4 "2018-03-10T06:00:55Z")

</div>

Is there a place where I can track the performance effects of this change?

---

<div class="post-metadata">

**Author:** ![Michael\_Gottesman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_gottesman/32/280_2.png) [@Michael\_Gottesman](https://forums.swift.org/u/Michael_Gottesman)\
**Post date:** [March 10, 2018, 6:21pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/5 "2018-03-10T18:21:47Z")

</div>

Not externally. There are some things internally, I would ask Erik about it offline. He maintains the stuff.

---

<div class="post-metadata">

**Author:** ![Michael\_Gottesman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_gottesman/32/280_2.png) [@Michael\_Gottesman](https://forums.swift.org/u/Michael_Gottesman)\
**Post date:** [March 10, 2018, 6:22pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/6 "2018-03-10T18:22:31Z")

</div>

I just updated all of the tests in tree that need updates for +0 to have a REQUIRES: plus\_one\_runtime feature.

The next step is to land the plus\_zero versions of these tests.

---

<div class="post-metadata">

**Author:** ![Michael\_Gottesman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_gottesman/32/280_2.png) [@Michael\_Gottesman](https://forums.swift.org/u/Michael_Gottesman)\
**Post date:** [March 10, 2018, 6:35pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/7 "2018-03-10T18:35:31Z")

</div>

PR for the initial plus\_zero tests: [[+0-all-args] Update plus zero tests. by gottesmm · Pull Request #15146 · apple/swift · GitHub](https://github.com/apple/swift/pull/15146)

---

<div class="post-metadata">

**Author:** ![Michael\_Gottesman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_gottesman/32/280_2.png) [@Michael\_Gottesman](https://forums.swift.org/u/Michael_Gottesman)\
**Post date:** [March 14, 2018, 7:28pm UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/8 "2018-03-14T19:28:30Z")

</div>

Just an FYI. Turns out accomplishing this plan took more non-trivial work than expected. I was spending a bunch of time to create the tooling. I am switching back to the traditional change the world way of doing things. Another time I will finish off this tooling, but that is its own "feature" so to speak.

---

<div class="post-metadata">

**Author:** ![Michael\_Gottesman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_gottesman/32/280_2.png) [@Michael\_Gottesman](https://forums.swift.org/u/Michael_Gottesman)\
**Post date:** [March 20, 2018, 6:14am UTC](https://forums.swift.org/t/plan-to-change-the-convention-of-passed-normal-parameters-from-1-to-0/10779/9 "2018-03-20T06:14:04Z")

</div>

Just an FYI. I did the "change the world merge" in 54b38d4c8b422cebf0f72be6ca42ecf26e0cd0f1.
