Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftownership borrowing consumingSingle-choice MCQ

Why does the following compile error occur, and what category of check produces it?

func add(_ x: inout Int, _ y: inout Int) { x += y } func demo() { var n = 5 add(&n, &n) }