Here are three yang modules like below:
module A { import B { prefix b; }
list aa { key a1; leaf a1; leaf a2 { type string; } } }
module B { list bb { key b1; leaf b1; leaf b2; } }
module A-deviation { import A { prefix a; } import B { prefix b; }
deviation "/a:aa/a:a2" { deviate replace { type leafref { path "/b:bb/b:b1" } } } }
Note that i did try replace in A-deviation like
deviation "/a:aa/a:a2" { deviate replace { type boolean; } }
which compiled success.
And i checked the rfc6020 also. There is no describtion to forbid us to do type leafref replace.
Is this an issue.
Looking forward for your reply.