79. In Schedule 1, after paragraph 8 insert—
“8A.—(1) A person who—
(a)is settled in the United Kingdom;
(b)was ordinarily resident in Wales and settled in the United Kingdom immediately before leaving the United Kingdom and who has exercised a right of residence before IP completion day;
(c)was ordinarily resident immediately before IP completion day—
(i)in the territory comprising Gibraltar, the European Economic Area and Switzerland; or
(ii)in the United Kingdom where that ordinary residence began after 31 December 2017 immediately following a period of ordinary residence in the territory comprising Gibraltar, the European Economic Area and Switzerland,
and has remained ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the European Economic Area and Switzerland throughout the period beginning on IP completion day and ending immediately before the first day of the first academic year of the course;
(d)is ordinarily resident in the United Kingdom on the day on which the first term of the first academic year actually begins;
(e)has been ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the European Economic Area and Switzerland throughout the three-year period preceding the first day of the first academic year of the course; and
(f)in a case where the person’s ordinary residence referred to in paragraph (e) was wholly or mainly for the purpose of receiving full-time education, was ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the European Economic Area and Switzerland immediately before the period of ordinary residence referred to in paragraph (e).
(2) For the purposes of this paragraph, a person has exercised a right of residence if that person is a United Kingdom national, a family member of a United Kingdom national for the purposes of Article 7 of Directive 2004/38 (or corresponding purposes under the EEA Agreement or Swiss Agreement) or a person who had the right of permanent residence who in each case has exercised a right under Article 7 of Directive 2004/38 or any equivalent right under the EEA Agreement or Swiss Agreement in a state other than the United Kingdom or, in the case of a person who is settled in the United Kingdom and had the right of permanent residence, if the person has gone to the state within the territory comprising the European Economic Area and Switzerland of which the person is a national or of which the person in relation to whom the person is a family member is a national.
(3) For the purposes of sub-paragraph (2), a person had the right of permanent residence if they had a right which arose under Directive 2004/38 to reside permanently in the United Kingdom without restriction.”