<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>iOYES</title>
    <link>https://green1229.tistory.com/</link>
    <description>Green is Green </description>
    <language>ko</language>
    <pubDate>Thu, 30 Apr 2026 03:05:58 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>GREEN.1229</managingEditor>
    <image>
      <title>iOYES</title>
      <url>https://tistory1.daumcdn.net/tistory/4326025/attach/5dc0ba3d4d3c460d8c291fa6a8cfb2d1</url>
      <link>https://green1229.tistory.com</link>
    </image>
    <item>
      <title>[SE-0520] Discardable result use in Task initializers</title>
      <link>https://green1229.tistory.com/617</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;SE-0520 &amp;mdash; Task 이니셜라이저에서의 Discardable result 처리&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b6H7do/dJMcacbOBTb/HYjteRQiVGy4tnTIBdMx2K/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b6H7do/dJMcacbOBTb/HYjteRQiVGy4tnTIBdMx2K/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b6H7do/dJMcacbOBTb/HYjteRQiVGy4tnTIBdMx2K/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb6H7do%2FdJMcacbOBTb%2FHYjteRQiVGy4tnTIBdMx2K%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Proposal:&lt;/b&gt;&amp;nbsp;SE-0520&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Author:&lt;/b&gt;&amp;nbsp;Konrad 'ktoso' Malawski&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Status:&lt;/b&gt;&amp;nbsp;Accepted&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;현재 아래 코드는 아무런 경고 없이 컴파일됩니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;Task { // no warning
  try boom() 
}
print(&quot;Yay!&quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;간단한 예시에서는 &lt;b&gt;에러를 놓쳤다는 게 명확하지만, 실제 코드베이스에서는 노이즈가 많아서 에러를 조용히 무시했다는 사실을 놓치기 쉽거든요.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 문제는 Swift 커뮤니티에서 여러 차례 제기되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://forums.swift.org/t/task-initializer-with-throwing-closure-swallows-error/56066&quot;&gt;Task initializer with throwing closure swallows error&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://forums.swift.org/t/pitch-non-discardable-throwing-tasks/74138&quot;&gt;Pitch: non-discardable throwing tasks&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://forums.swift.org/t/pitch-improved-error-handling-in-unstructured-task-initializers/74826&quot;&gt;Pitch: Improved error handling in unstructured task initializers&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;원래&amp;nbsp;Task {}&amp;nbsp;문법은 주로&amp;nbsp;&lt;b&gt;fire-and-forget&lt;/b&gt;&amp;nbsp;용도로 설계되었고, &lt;b&gt;throw된 에러를 처리하는 경우를 충분히 고려하지 않았습니다. &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 동작은 Swift의 에러 핸들링 모델과 일관성이 없고, 에러가 조용히 무시되어 찾기 어려운 버그로 이어집니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Detailed Design&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;concurrency 라이브러리는&amp;nbsp;T&lt;b&gt;ask.init,&amp;nbsp;Task.detached,&amp;nbsp;Task.immediate,&amp;nbsp;Task.immediateDetached에 typed throws를 도입&lt;/b&gt;했습니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이를 기반으로 throw 타입(throws(Failure))을 인식하는 새로운 경고 메커니즘을 도입합니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Failure 타입이&amp;nbsp;Never가 아닌 경우에만 경고가 발생합니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;워닝 동작은 다음과 같아요~&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;Task {  }
// no warning

Task { throws in ... } 
// warning: Unstructured throwing task was not used, which may accidentally ignore errors thrown inside the task [#NoUseUnstructuredThrowingTask]
// note: To silence this warning, handle the error inside the task, or store/discard the task value explicitly

Task { throws(Boom) in ... } 
// warning: Unstructured throwing task was not used, which may accidentally ignore errors thrown inside the task [#NoUseUnstructuredThrowingTask]
// note: To silence this warning, handle the error inside the task, or store/discard the task value explicitly

Task { throws(Never) in ... }
// no warning&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;동일한 변경사항이 모든 unstructured task 이니셜라이저에 적용됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;경고를 없애는 방법&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;명시적으로 값을 무시하면 경고를 없앨 수 있습니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;_ = Task { throws in ... }&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;혹은 실제로 값을 사용하는 것이 권장되는 방법입니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;throw된 에러를 관찰하려면 이렇게 하면 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let task = Task { throws in } 

let value = try await task.value // task가 실패하면 에러를 throw합니다&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Source Compatibility / ABI&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;소스 호환성은 유지되지만, 새로운 경고가 발생할 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;경고는&amp;nbsp;_ = Task { try boom() }처럼 명시적으로 무시하면 됩니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;컴파일 타임 진단 동작만 변경되므로 ABI에는 영향이 없습니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Alternatives Considered&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;아무것도 하지 않기&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;커뮤니티에서 충분히 오랫동안 문제로 제기되어 왔기 때문에, 제안자는 현 상태를 유지하는 건 적절하지 않다고 판단했어요.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;non-throwing 이니셜라이저에서도 discardableResult 제거하기&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;throw하지 않는 Task는 대부분 의도적인 fire-and-forget입니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;결과값에 관심이 있다면 이미 task를 저장하거나 즉시 await했을 테니까요. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;그래서 제안자는 throw하지 않는 이니셜라이저에는 이 변경을 적용하지 않기로 했습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;작지만 굉장히 실용적인 변경입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Task { try something() }처럼 작성했다가 에러를 조용히 삼키는 버그는 실제 코드베이스에서 찾기 굉장히 어렵거든요. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 변경으로 컴파일러가 명시적으로 경고를 내려주니, 에러 처리에 대한 개발자의 의도를 코드에 드러낼 수 있게 됩니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift의 에러 핸들링 철학인&amp;nbsp;&lt;b&gt;&quot;에러는 반드시 처리되어야 한다&quot;&lt;/b&gt;&amp;nbsp;와 한층 더 일관성 있게 맞춰진 변경이라고 생각합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1777078504075&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;object&quot; data-og-title=&quot;swift-evolution/proposals/0520-discardableresult-task-initializers.md at main &amp;middot; swiftlang/swift-evolution&quot; data-og-description=&quot;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&quot; data-og-host=&quot;github.com&quot; data-og-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0520-discardableresult-task-initializers.md&quot; data-og-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0520-discardableresult-task-initializers.md&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/Az9Xs/dJMb84qbiCW/aK0kPkQl1eGNL9AxhGNFwK/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/bKrAgW/dJMb88e3j2G/dEtY9U8oc3DNieVkGID0K1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0520-discardableresult-task-initializers.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0520-discardableresult-task-initializers.md&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/Az9Xs/dJMb84qbiCW/aK0kPkQl1eGNL9AxhGNFwK/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/bKrAgW/dJMb88e3j2G/dEtY9U8oc3DNieVkGID0K1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift-evolution/proposals/0520-discardableresult-task-initializers.md at main &amp;middot; swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;github.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1777078505607&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;Pitch: Remove discardableResult from throwing task initializers&quot; data-og-description=&quot;Hi everyone, continuing the effort to improve small yet valuable things in the Concurrency library, I&amp;rsquo;d like to propose an often discussed but never finished change to Task.init and friends: removing the @discardableResult when the operation is throwing.&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/pitch-remove-discardableresult-from-throwing-task-initializers/84721&quot; data-og-url=&quot;https://forums.swift.org/t/pitch-remove-discardableresult-from-throwing-task-initializers/84721&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/dgblND/dJMb8ZvD59R/wOvTnNG13P2nPsskxaLZs0/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bCml1K/dJMb9kT5B2N/9PuD6lniem5zlkSEXona51/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/pitch-remove-discardableresult-from-throwing-task-initializers/84721&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/pitch-remove-discardableresult-from-throwing-task-initializers/84721&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/dgblND/dJMb8ZvD59R/wOvTnNG13P2nPsskxaLZs0/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bCml1K/dJMb9kT5B2N/9PuD6lniem5zlkSEXona51/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;Pitch: Remove discardableResult from throwing task initializers&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hi everyone, continuing the effort to improve small yet valuable things in the Concurrency library, I&amp;rsquo;d like to propose an often discussed but never finished change to Task.init and friends: removing the @discardableResult when the operation is throwing.&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>discardableResult</category>
      <category>ios</category>
      <category>SE-0520</category>
      <category>SWIFT</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/617</guid>
      <comments>https://green1229.tistory.com/617#entry617comment</comments>
      <pubDate>Sat, 25 Apr 2026 09:58:01 +0900</pubDate>
    </item>
    <item>
      <title>[SE-0519] Borrow and Inout types for safe, first-class references</title>
      <link>https://green1229.tistory.com/616</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는 &lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;안전한 first-class 참조를 위한&amp;nbsp;Borrow와&amp;nbsp;Inout&amp;nbsp;타입&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/B8YGj/dJMcafzsr9i/3epmtHdSswGEIQZwvSSYyK/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/B8YGj/dJMcafzsr9i/3epmtHdSswGEIQZwvSSYyK/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/B8YGj/dJMcafzsr9i/3epmtHdSswGEIQZwvSSYyK/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FB8YGj%2FdJMcafzsr9i%2F3epmtHdSswGEIQZwvSSYyK%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Proposal:&lt;/b&gt;&amp;nbsp;SE-0519&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Authors:&lt;/b&gt;&amp;nbsp;Joe Groff, Alejandro Alonso&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Status:&lt;/b&gt;&amp;nbsp;Active review (March 4...17, 2026)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Swift는 함수 호출의 일부로 값에 대한 임시 접근을 제공&lt;/b&gt;할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;inout&lt;/b&gt;&amp;nbsp;파라미터: 호출자가 소유한 값에 대한 임시&amp;nbsp;&lt;b&gt;독점(exclusive) 접근&lt;/b&gt;을 받습니다. 호출된 쪽에서 파라미터를 수정하거나 현재 값을 소비(consume)할 수 있고, 호출자는 함수가 반환되면 소유권을 다시 가져옵니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;borrowing&lt;/b&gt;&amp;nbsp;파라미터: 호출자로부터 값에 대한 임시&amp;nbsp;&lt;b&gt;공유(shared) 접근&lt;/b&gt;을 받습니다. 다른 곳에서도 동시에 접근할 수 있으므로 일반적으로 값을 읽기만 할 수 있지만, 독립적인 복사본 없이도 접근이 가능합니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이런 종류의 참조를 함수 호출의 범위 밖에서도 로컬 변수 바인딩, 다른 타입의 멤버, 제네릭 컨테이너의 요소 등으로 사용할 수 있으면 매우 유용할 것입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기존에는 클래스로 값을 박싱(boxing)하고 참조를 전달하는 방법을 썼는데, 이렇게 하면 메모리 할당, 레퍼런스 카운팅, 동적 독점성 검사 오버헤드가 발생합니다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;UnsafePointer는 당연히 unsafe하고 Swift의 고수준 의미론과 어색하게 상호작용해서 올바르게 사용하려면 굉장히 세심한 주의가 필요했거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Proposed Solution&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;표준 라이브러리에 두 개의 새로운 제네릭 타입을 도입합니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;둘 다 non-Escapable&amp;nbsp;타입으로 표현됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Borrow&amp;lt;T&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다른 값에 대한&amp;nbsp;&lt;b&gt;공유 borrow&lt;/b&gt;를 나타내며, 대상 값을 읽을 수 있지만 소비하거나 수정할 수는 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;public struct Borrow&amp;lt;Value: ~Copyable&amp;gt;: Copyable &amp;amp; ~Escapable {
  @_lifetime(borrow target)
  public init(_ target: borrowing Value)

  public var value: Value { borrow }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Inout&amp;lt;T&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다른 값에 대한&amp;nbsp;&lt;b&gt;독점 접근&lt;/b&gt;을 나타내며,&amp;nbsp;Inout의 소유자가 대상 값을 수정하고&amp;nbsp;Inout&amp;nbsp;값이 활성화된 동안 독점적으로 사용할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;public struct Inout&amp;lt;Value: ~Copyable&amp;gt;: ~Copyable &amp;amp; ~Escapable {
  @_lifetime(&amp;amp;target)
  public init(_ target: inout Value)

  public var value: Value { borrow; mutate }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;두 타입의 인터페이스는 lifetime dependencies를 사용해&amp;nbsp;~Escapable&amp;nbsp;값을 생성하고,&amp;nbsp;borrow와&amp;nbsp;mutateaccessor를 통해 불필요한 제한 없이 대상 값에 효율적으로 접근합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;기본 사용 예시&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;참조는&amp;nbsp;Borrow.init&amp;nbsp;또는&amp;nbsp;Inout.init에 대상을 전달해 생성하고,&amp;nbsp;value&amp;nbsp;프로퍼티로 대상 값에 접근합니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;딕셔너리에서 키를 한 번만 조회하고 반복 수정하는 예시입니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;func updateTotal(in dictionary: inout [String: Int], for key: String,
                 with values: [Int]) {
  // 딕셔너리에서 키를 한 번만 조회합니다...
  var entry = Inout(&amp;amp;dictionary[key, default: 0])

  // ...그리고 해시 테이블을 반복적으로 탐색하지 않고 반복 수정합니다
  for value in values {
    entry.value += value
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;실험적인 lifetimes 기능을 사용하면 참조를 반환하는 함수도 작성할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct Vec3 {
  var x, y, z: Double

  @_lifetime(&amp;amp;self)
  mutating func at(index: Int) -&amp;gt; Inout&amp;lt;Double&amp;gt; {
    switch index {
    case 0: return Inout(&amp;amp;x)
    case 1: return Inout(&amp;amp;y)
    case 2: return Inout(&amp;amp;z)
    default:
      fatalError(&quot;out of bounds&quot;)
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrow와 Inout은 다른 non-Escapable 타입의 필드로도 사용할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// struct-of-arrays 형태의 사람 레코드
struct People {
  var names: [String]
  var ages: [Int]

  subscript(i: Int) -&amp;gt; Person {
    @_lifetime(&amp;amp;self)
    mutating get {
      return Person(name: &amp;amp;names[i], age: &amp;amp;ages[i])
    }
  }
}

// 단일 사람에 대한 mutable 참조
struct Person: ~Copyable, ~Escapable {
  var name: Inout&amp;lt;String&amp;gt;
  var age: Inout&amp;lt;Int&amp;gt;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;또한 제네릭 파라미터로도 사용할 수 있어서, non-Escapable 타입을 지원하는 컨테이너와 래퍼에 참조를 담을 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@_lifetime(&amp;amp;array)
func element(of array: inout [Int], at: Int) -&amp;gt; Inout&amp;lt;Int&amp;gt;? {
  if at &amp;gt;= 0 &amp;amp;&amp;amp; at &amp;lt; array.count {
    return &amp;amp;array[at]
  } else {
    return nil
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Detailed Design&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Lifetime dependence&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrow와&amp;nbsp;Inout은 모두 non-Escapable&amp;nbsp;타입입니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;생성되면 대상에 대한 lifetime dependency를 가지므로, 대상 값이 borrow 또는 독점 접근 상태를 유지할 수 있는 동안에만 사용 가능합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;var totals = [17, 38]

do {
  let apples = Borrow(totals[0])

  print(apples.value) // 17 출력

  apples.value += 2 // ERROR, Borrow.value는 읽기 전용

  totals[1] += 1 // ERROR, borrow 중인 `totals`를 수정할 수 없음

  print(totals[1]) // 38 출력. totals를 다시 borrow하는 건 가능
  print(apples.value) // 17 출력
}

do {
  var bananas = Inout(&amp;amp;totals[1])

  bananas.value += 2 // `Inout`을 통해 값을 수정 가능

  print(bananas.value) // 40 출력

  print(totals[1]) // ERROR, totals는 `bananas`가 독점 접근 중

  bananas.value += 2
  print(bananas.value) // 42 출력
}

print(totals) // [17, 42] 출력&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 동작은&amp;nbsp;Array와&amp;nbsp;span,&amp;nbsp;mutableSpan&amp;nbsp;프로퍼티를 통해 접근하는&amp;nbsp;Span&amp;nbsp;또는&amp;nbsp;MutableSpan&amp;nbsp;값 사이의 상호작용과 유사합니다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrow와&amp;nbsp;Inout은 각각&amp;nbsp;Span과&amp;nbsp;MutableSpan의 단일 값 버전이라고 볼 수 있거든요.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;nontrivial 접근과의 상호작용&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrow는 모든 값을,&amp;nbsp;Inout은 모든 mutable 위치를 대상으로 할 수 있습니다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;get/set&amp;nbsp;쌍,&amp;nbsp;yielding&amp;nbsp;코루틴 accessor, 동적 독점성 검사가 적용된 stored property,&amp;nbsp;didSet/willSet&amp;nbsp;observer가 있는 경우도 포함됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct NoisyCounter {
  private var _value: Int

  var value: Int {
    get {
      print(&quot;counted \(_value)&quot;)
      return _value
    }
    set {
      print(&quot;updating counter to \(newValue)&quot;)
      _value = newValue
    }
  }
}

var counter = NoisyCounter(67)
do {
  var counterRef = Inout(&amp;amp;counter.value) // `counter.value` 접근 시작, &quot;counted 67&quot; 출력
  counterRef.value += 1
  counterRef.value += 1
  // `counter.value` 접근 종료, &quot;updating counter to 69&quot; 출력
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;단,&amp;nbsp;Borrow와&amp;nbsp;Inout은 접근을 종료하기 위한 컨텍스트를 캡처하지 않기 때문에, nontrivial 접근에서 파생된 경우 일반적으로 lifetime을 즉각적인 호출자 너머로 확장할 수 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@_lifetime(&amp;amp;target)
func noisyCounterRef(from target: inout NoisyCounter) -&amp;gt; Inout&amp;lt;Int&amp;gt; {
  // ERROR, formal access 밖으로 `Inout`의 lifetime을 확장하게 됨
  return Inout(&amp;amp;target.value)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;struct&amp;nbsp;stored property 직접 접근, 불변&amp;nbsp;class&amp;nbsp;stored property 직접 접근,&amp;nbsp;borrow나&amp;nbsp;mutate&amp;nbsp;accessor를 통한 접근은 종료 시 코드 실행이 필요 없으므로 이 제한이 적용되지 않습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Borrow의 표현 방식&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrow&amp;lt;Value&amp;gt;는&amp;nbsp;Value&amp;nbsp;타입의 속성에 따라 포인터 표현 또는 값의 비트 복사 표현을 사용합니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다음 조건 중 하나라도 해당되면 포인터 표현을 사용합니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;MemoryLayout&amp;lt;Value&amp;gt;.size가&amp;nbsp;4 * MemoryLayout&amp;lt;Int&amp;gt;.size보다 큰 경우&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Value가&amp;nbsp;bitwise-borrowable이 아닌 경우&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Value가&amp;nbsp;addressable-for-dependencies인 경우&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Int처럼 메모리 어디에서나 동일한 의미를 갖는 타입은&amp;nbsp;&lt;b&gt;bitwise-borrowable&lt;/b&gt;이라 포인터 없이 값으로 전달됩니다. 반면&amp;nbsp;InlineArray처럼&amp;nbsp;Span을 파생시키는 등 내부 메모리 주소에 의존하는 타입은&amp;nbsp;&lt;b&gt;addressable-for-dependencies&lt;/b&gt;로 분류되어 포인터 표현을 사용합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;C, Objective-C, C++에서 import된&amp;nbsp;struct,&amp;nbsp;union,&amp;nbsp;class&amp;nbsp;타입은 항상&amp;nbsp;addressable-for-dependencies로 간주됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Inout의 표현 방식&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;inout&amp;nbsp;파라미터는 항상 주소로 전달되므로,&amp;nbsp;Inout은 모든 경우에 포인터 표현을 사용합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Source Compatibility / ABI&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrow와&amp;nbsp;Inout이라는 이름을 가진 타입이 기존 코드에 존재할 수 있지만, Swift의 이름 조회 규칙상 로컬 정의 및 명시적으로 import된 이름이 표준 라이브러리보다 우선하므로 기존 코드는 그대로 컴파일됩니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 제안은 additive하며 기존 코드의 ABI에 영향을 주지 않습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;단, 제네릭 지원에는 새로운 런타임 타입 레이아웃 기능이 필요하므로, 구버전 Swift 런타임을 타겟으로 할 때 가용성이 제한될 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Future Directions&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;로컬 참조 바인딩 문법 (sugar):&lt;/b&gt;&amp;nbsp;Borrow/Inout을 명시적으로 형성하는 것의 sugar로,&amp;nbsp;borrow x = y처럼 참조 바인딩 문법을 도입하는 것을 고려 중입니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;암묵적 역참조 / 멤버 포워딩:&lt;/b&gt;&amp;nbsp;@dynamicMemberLookup이나 Rust의&amp;nbsp;Deref&amp;nbsp;트레이트처럼&amp;nbsp;value를 거치지 않고 대상 멤버에 직접 접근하는 방법도 검토 중입니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;~Escapable&amp;nbsp;대상 타입 지원:&lt;/b&gt;&amp;nbsp;현재는 대상 타입이&amp;nbsp;Escapable이어야 한다는 제약이 있는데, 컴파일러 구현 한계로 인한 것으로 향후 개선될 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;exclusive&amp;nbsp;소유권 또는 reborrow:&lt;/b&gt;&amp;nbsp;var&amp;nbsp;바인딩 없이도&amp;nbsp;Inout.value를 통한 mutation이 가능하도록 하는 방법을 검토 중입니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Alternatives Considered&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Inout&amp;nbsp;이름 짓기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;일반적인 네이밍 컨벤션대로라면&amp;nbsp;InOut이 맞겠지만, 저자들은&amp;nbsp;inout이 두 단어의 조합이 아닌 하나의 키워드처럼 느껴지기 때문에&amp;nbsp;Inout을 선택했습니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;과거에&amp;nbsp;inout을&amp;nbsp;mutating으로 대체하는 논의가 있었던 만큼&amp;nbsp;Mutable&amp;nbsp;같은 이름도 후보였습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;value&amp;nbsp;프로퍼티 이름&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;subscript로&amp;nbsp;reference[]처럼 역참조하거나,&amp;nbsp;target&amp;nbsp;같은 이름도 검토했지만,&amp;nbsp;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://forums.swift.org/t/pitch-box/84014&quot;&gt;제안된&amp;nbsp;Unique&amp;nbsp;타입&lt;/a&gt;의 인터페이스와 일관성을 맞추기 위해&amp;nbsp;value로 결정했습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrow와&amp;nbsp;Inout은 Swift에서 &lt;b&gt;오래도록 아쉬웠던 &quot;안전한 참조&quot; 문제를 드디어 언어 차원에서 해결하는 제안&lt;/b&gt;입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;클래스 박싱의 오버헤드도,&amp;nbsp;UnsafePointer의 위험성도 없이, 값에 대한 참조를 first-class로 다룰 수 있게 된다는 점이 정말 기대됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;특히 딕셔너리나 배열의 특정 요소를 반복적으로 수정해야 하는 시나리오에서 성능 이점이 체감될 것 같고,&amp;nbsp;~Escapable&amp;nbsp;타입 생태계와 함께 Swift의 소유권 모델이 한층 더 정교해지는 느낌이거든요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1775868925989&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;object&quot; data-og-title=&quot;swift-evolution/proposals/0519-borrow-inout-types.md at main &amp;middot; swiftlang/swift-evolution&quot; data-og-description=&quot;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&quot; data-og-host=&quot;github.com&quot; data-og-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0519-borrow-inout-types.md&quot; data-og-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0519-borrow-inout-types.md&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bnTqX3/dJMb9cBJc1k/Kxplb0opqpMghaf2HwMMh1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/UYb6c/dJMb9gxmwEc/csbeovE8Bxol0HUAtMobA0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0519-borrow-inout-types.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0519-borrow-inout-types.md&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bnTqX3/dJMb9cBJc1k/Kxplb0opqpMghaf2HwMMh1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/UYb6c/dJMb9gxmwEc/csbeovE8Bxol0HUAtMobA0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift-evolution/proposals/0519-borrow-inout-types.md at main &amp;middot; swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;github.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;figure id=&quot;og_1775868931930&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;SE-0507: Borrow and Mutate Accessors&quot; data-og-description=&quot;Hi everyone, The review of SE-0507 &amp;quot;Borrow and Mutate Accessors&amp;quot; begins now and runs through February 9, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to &quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot; data-og-url=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/8xxkf/dJMb82eN7qJ/glrCXx2XMQ8U9ncVkWH070/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cKKkPl/dJMb8RRSY7I/BM6M5gYOmgTgkc1KEVie20/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/8xxkf/dJMb82eN7qJ/glrCXx2XMQ8U9ncVkWH070/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cKKkPl/dJMb8RRSY7I/BM6M5gYOmgTgkc1KEVie20/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;SE-0507: Borrow and Mutate Accessors&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hi everyone, The review of SE-0507 &quot;Borrow and Mutate Accessors&quot; begins now and runs through February 9, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>ios</category>
      <category>SE-0519</category>
      <category>SWIFT</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/616</guid>
      <comments>https://green1229.tistory.com/616#entry616comment</comments>
      <pubDate>Sat, 11 Apr 2026 09:55:42 +0900</pubDate>
    </item>
    <item>
      <title>[SE-0518] tide-Sendable</title>
      <link>https://green1229.tistory.com/615</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;SE-0518 &amp;mdash;&amp;nbsp;~Sendable로 non-Sendable&amp;nbsp;타입을 명시적으로 표현하기&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/sEUbW/dJMcajaEIfH/rhOB8MPnKyukc2eGB2LeD1/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/sEUbW/dJMcajaEIfH/rhOB8MPnKyukc2eGB2LeD1/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/sEUbW/dJMcajaEIfH/rhOB8MPnKyukc2eGB2LeD1/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FsEUbW%2FdJMcajaEIfH%2FrhOB8MPnKyukc2eGB2LeD1%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Proposal:&lt;/b&gt;&amp;nbsp;SE-0518&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Status:&lt;/b&gt;&amp;nbsp;Implemented (Swift 6.4)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Experimental Feature Flag:&lt;/b&gt;&amp;nbsp;TildeSendable&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;public 타입이&amp;nbsp;Sendable을 명시적으로 conform하지 않을 때, 그 의도를 파악하기가 쉽지 않습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;아직&amp;nbsp;Sendable&amp;nbsp;conformance를 추가하지 않은 건지, 아니면 의도적으로 non-Sendable로 설계한 건지가 불분명&lt;/b&gt;하거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이를 판단하려면 타입의 스토리지 구조와 동기화 메커니즘 같은 구현 세부사항을 알아야 하는데, &lt;b&gt;라이브러리 외부에서는 접근하기 어렵습니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;또한 클래스 자체는 non-Sendable이지만, 특정 서브클래스는&amp;nbsp;Sendable이어야 하는 상황도 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;기존에는 이를 아래처럼 unavailable extension으로 표현했는데요.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;class Base {
   // ...
}

@available(*, unavailable)
extension Base: Sendable {
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;문제는 unavailable conformance는 서브클래스에&amp;nbsp;&lt;b&gt;그대로 상속&lt;/b&gt;된다는 점입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;그래서 thread-safe 서브클래스를 만들려고 해도,&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;final class ThreadSafe: Base, @unchecked Sendable {
   // ...
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;다음과 같은 경고가 발생합니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;warning: conformance of 'ThreadSafe' to protocol 'Sendable' is already unavailable&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;서브클래스가&amp;nbsp;Sendable이 될 수도 있고 아닐 수도 있는, 이 세 번째 상태를 언&lt;b&gt;어 차원에서 명확하게 표현할 방법이 없었던 거죠.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;라이브러리 작성자 입장에서는 API의&amp;nbsp;Sendable 판단을&amp;nbsp;체계적으로 하기도 어렵고, 클라이언트에게 의도를 전달하기도 힘든 상황이었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;SE-0518은&amp;nbsp;~&lt;b&gt;Sendable&amp;nbsp;conformance 문법을 도입해 타입이 명시적으로 non-Sendable임을 나타낼 수 있게 합니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// `ExecutionResult`는 감사 결과 non-`Sendable`로 명시.
// non-Sendable associated value를 가진 케이스가 있기 때문입니다.
public enum ExecutionResult: ~Sendable {
case success
// ...
// ...
case failure(NonSendable)
// ...
}

// `Base`는 감사 결과 non-`Sendable`로 명시.
// 서브클래스는 non-`Sendable` mutable state를 추가하거나,
// 상태를 보호하거나 상수로 만들어 `Sendable`로 표시될 수 있습니다.
public class Base: ~Sendable {
  // ...
}

// 이 서브클래스는 감사 결과 `Sendable`로 판단됩니다.
public class ThreadSafeImpl: Base, @unchecked Sendable {
    // `Base`의 `value`를 lock 등을 통해 안전하게 접근합니다.
}

// 이 서브클래스는 mutable non-`Sendable` state를 가지므로 non-`Sendable`입니다.
public class UnsafeImpl: Base {
   var x: NonSendable
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;~Sendable&amp;nbsp;문법은 &lt;b&gt;타입에만 적용 가능&lt;/b&gt;합니다. 제네릭 파라미터 같은 다른 선언은 기본적으로 이미&amp;nbsp;~Sendable이기 때문입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Detailed Design&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;~Sendable은&amp;nbsp;~Copyable,&amp;nbsp;~Escapable,&amp;nbsp;~BitwiseCopyable과 같이 tilde(~) 접두사를 사용해 conformance 억제를 표현합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;기본 사용&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// Sendable inference 억제
struct NotSendableType: ~Sendable {
    let data: String
}

// 다른 conformance와 함께 사용 가능
struct MyType: Equatable, ~Sendable {
    let id: UUID
}

// 클래스에도 적용 가능
class MyClass: ~Sendable {
    private let data = 0
}&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Extension에서는 사용 불가&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;억제 선언은 반드시 타입 선언부에서 해야 합니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Extension에서 사용하면 기존 코드의 의미가 바뀔 위험이 있거든요.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Test: ~Sendable {} // Error!&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;제네릭 파라미터, 프로토콜에는 사용 불가&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;억제할 implied&amp;nbsp;Sendable&amp;nbsp;요구사항이 없기 때문에 거부됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;protocol P: ~Sendable {} // Error!
struct Test&amp;lt;T: ~Sendable&amp;gt; {} // Error!
func test&amp;lt;T: ~Sendable&amp;gt;(_: T) {} // Error!&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Sendable&amp;nbsp;요구사항을 만족시킬 수 없음&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;unavailable extension과 마찬가지로,&amp;nbsp;~Sendable&amp;nbsp;타입은&amp;nbsp;Sendable&amp;nbsp;요구사항을 만족시킬 수 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;func processData&amp;lt;T: Sendable&amp;gt;(_ data: T) { }

struct NotSendable: ~Sendable {
    let value: Int
}

processData(NotSendable(value: 42)) // error: type 'NotSendable' does not conform to the 'Sendable' protocol&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;서브클래스에는 영향 없음&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;unavailable extension과의 가장 큰 차이점입니다.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;~Sendable은 서브클래스에 상속되지 않습니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;class A: ~Sendable {
}

final class B: A, @unchecked Sendable {
}

func takesSendable&amp;lt;T: Sendable&amp;gt;(_: T) {
}

takesSendable(B()) // Ok!&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Sendable과&amp;nbsp;~Sendable&amp;nbsp;동시 사용 불가&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;무조건적으로 둘 다 conform하려 하면 컴파일 오류가 발생합니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// actor는 항상 `Sendable`입니다.
actor A: ~Sendable { // error: cannot both conform to and suppress conformance to 'Sendable'
}

struct Container&amp;lt;T&amp;gt;: ~Sendable {
    let value: T
}

extension Container: Sendable {} // error: cannot both conform to and suppress conformance to 'Sendable'&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;상위 클래스나 프로토콜에서 상속된 명시적/파생 Sendable conformance에도 동일하게 적용됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;protocol IsolatedProtocol: Sendable {
}

struct Test: IsolatedProtocol, ~Sendable { // error: cannot both conform to and suppress conformance to 'Sendable'
}

@MainActor
class IsolatedBase { // global actor isolated 타입은 `Sendable`입니다.
}

class Refined: IsolatedBase, ~Sendable { // error: cannot both conform to and suppress conformance to 'Sendable'
}&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;조건부 conformance는 허용&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Container: Sendable where T: Sendable {} // Ok!&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;조건부&amp;nbsp;Sendable&amp;nbsp;conformance는 여전히 유용하거든요.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;API 작성자가 타입이 특정 조건에서만&amp;nbsp;Sendable임을 표현하고 싶을 때 활용할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;ExplicitSendable 추적 플래그&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Swift 컴파일러는 public 타입의 sendability를 감사할 수 있는 방법을 제공&lt;/b&gt;합니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기존에는&amp;nbsp;-require-explicit-sendable&amp;nbsp;플래그를 사용했는데, 이번 제안에서&amp;nbsp;~Sendable을 지원하도록 업데이트되고&amp;nbsp;ExplicitSendable&amp;nbsp;진단 그룹으로 전환되었습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;기본적으로 비활성화되어 있으며,&amp;nbsp;-Wwarning ExplicitSendable로 활성화&lt;/b&gt;할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Alternatives Considered&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;@nonSendable&amp;nbsp;속성&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@nonSendable
struct MyType {
    let value: Int
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 방법도 고려됐지만, 프로토콜 conformance 방식이 더 ergonomic하고,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;~Copyable,&amp;nbsp;~Escapable&amp;nbsp;같은 기존 conformance 억제 컨벤션과도 일관성이 있기 때문에 채택되지 않았습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Future Directions&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 제안은&amp;nbsp;Sendable에만 집중했지만,&amp;nbsp;Equatable,&amp;nbsp;Hashable,&amp;nbsp;RawRepresentable&amp;nbsp;같이 암묵적으로 추론되는 다른 프로토콜 conformance에도&amp;nbsp;~&amp;nbsp;문법이 적용될 수 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;각각 고유한 특이점이 있어 별도 제안이 필요할 것으로 보입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;~Sendable은 작지만 굉장히 실용적인 추가입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기존에는 non-Sendable&amp;nbsp;의도를 표현하려면 unavailable extension이라는 다소 우회적인 방법을 써야 했고,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;서브클래스에 상속된다는 부작용까지 감수해야 했거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이제&amp;nbsp;~Sendable로 그 의도를 명확하게 선언하면서, 서브클래스의&amp;nbsp;Sendable&amp;nbsp;가능성도 열어둘 수 있게 되었습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;라이브러리 작성자 입장에서는 API의 Sendability 추적 및 판단을 훨씬 체계적으로 할 수 있을 것 같습니다  &lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1775345083694&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;object&quot; data-og-title=&quot;swift-evolution/proposals/0518-tilde-sendable.md at main &amp;middot; swiftlang/swift-evolution&quot; data-og-description=&quot;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&quot; data-og-host=&quot;github.com&quot; data-og-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0518-tilde-sendable.md&quot; data-og-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0518-tilde-sendable.md&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/YhzYa/dJMb89yd8rs/xNCERvO9wOl8QcgMoEKlR0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/boiVbO/dJMb85WTSYc/iX2rONuu1AmRI8oz00hhW1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0518-tilde-sendable.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0518-tilde-sendable.md&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/YhzYa/dJMb89yd8rs/xNCERvO9wOl8QcgMoEKlR0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/boiVbO/dJMb85WTSYc/iX2rONuu1AmRI8oz00hhW1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift-evolution/proposals/0518-tilde-sendable.md at main &amp;middot; swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;github.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>ios</category>
      <category>SE-0518</category>
      <category>Sendable</category>
      <category>SWIFT</category>
      <category>~sendable</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/615</guid>
      <comments>https://green1229.tistory.com/615#entry615comment</comments>
      <pubDate>Sun, 5 Apr 2026 08:26:02 +0900</pubDate>
    </item>
    <item>
      <title>Swift 6.3</title>
      <link>https://green1229.tistory.com/614</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;Swift 6.3에서 릴리즈된 내용&lt;/b&gt;&lt;/span&gt;들을 정리해보겠습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;12313.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bCZ2pq/dJMcadIbicE/V9AW4BCfs9WpAwtCPEzcck/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bCZ2pq/dJMcadIbicE/V9AW4BCfs9WpAwtCPEzcck/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bCZ2pq/dJMcadIbicE/V9AW4BCfs9WpAwtCPEzcck/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbCZ2pq%2FdJMcadIbicE%2FV9AW4BCfs9WpAwtCPEzcck%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;12313.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;2026년 3월 24일, &lt;b&gt;Swift 6.3이 공식 릴리즈&lt;/b&gt;되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift는 소프트웨어 스택의 모든 레이어에서 사용할 수 있는 언어를 목표로 설계되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;임베디드 펌웨어, 인터넷 규모의 서비스, 풀-피처 모바일 앱을 만들든 간에,&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift는 강력한 안전성 보장, 필요할 때의 성능 제어, 그리고 표현력 있는 언어 기능과 API를 제공하거든요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3은 이러한 이점들을 스택 전반에 걸쳐 더 넓게 활용할 수 있도록 해줍니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;이번 릴리즈의 주요 내용은 다음과 같습니다&lt;/span&gt;&lt;/blockquote&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;더 유연한 C 상호운용성&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;크로스 플랫폼 빌드 툴링 개선&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;임베디드 환경에서의 Swift 개선&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;공식 Swift SDK for Android&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;언어 및 표준 라이브러리&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;C 상호운용성 (C Interoperability)&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3에서는&amp;nbsp;&lt;b&gt;@c&amp;nbsp;속성이 도입&lt;/b&gt;되었습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이를 통해 &lt;b&gt;Swift 함수와 enum을 C 코드에 노출&lt;/b&gt;할 수 있게 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;함수나 enum에&amp;nbsp;&lt;b&gt;@c를 붙이면, Swift가 생성된 C 헤더에 해당 선언을 포함&lt;/b&gt;시켜주고,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;그 헤더를 C/C++ 파일에서 include해서 사용&lt;/b&gt;할 수 있게 되거든요  &lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@c
func callFromC() { ... }&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;cpp&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;cpp&quot;&gt;&lt;code&gt;// Generated C header

void callFromC(void);&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;생성되는 C 선언에 커스텀 이름을 지정하는 것도 가능합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@c(MyLibrary_callFromC)
func callFromC() { ... }&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// Generated C header

void MyLibrary_callFromC(void);&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;@c는&amp;nbsp;@implementation과 함께도 사용할 수 있어요.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이를 통해 C 헤더에 선언된 함수에 대한 Swift 구현을 제공할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;cpp&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;cpp&quot;&gt;&lt;code&gt;// C header

void callFromC(void);&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// Implementation written in Swift

@c @implementation
func callFromC() { ... }&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;@c와&amp;nbsp;@implementation을 함께 사용하면, Swift는 생성된 헤더에 C 선언을 포함시키는 대신, Swift 함수가 C 헤더에 이미 존재하는 선언과 일치하는지 검증합니다.&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Module name selectors&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3에서는&amp;nbsp;&lt;b&gt;module selectors가 도입되어, 코드에서 사용하는 API가 어떤 모듈에서 온 것인지 명시적으로 지정&lt;/b&gt;할 수 있게 되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;동일한 이름의 API를 제공하는 모듈을 두 개 이상 import했을 때, module selector를 통해 어떤 API를 사용할지 명확하게 구분할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;lasso&quot; style=&quot;color: #000000; text-align: start;&quot;&gt;&lt;code&gt;import ModuleA
import ModuleB

let x = ModuleA::getValue() // Call 'getValue' from ModuleA
let y = ModuleB::getValue() // Call 'getValue' from ModuleB
&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;또한 Swift 6.3부터는 &lt;b&gt;Swift 모듈명을 사용해서 concurrency와 String processing 라이브러리 API에 접근하는 것도 가능&lt;/b&gt;합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;dts&quot; style=&quot;color: #000000; text-align: start;&quot;&gt;&lt;code&gt;let task = Swift::Task {
  // async work
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;라이브러리 API를 위한 성능 제어&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3에서는 라이브러리 작성자가 클라이언트에 대한 컴파일러 최적화를 더 세밀하게 제어할 수 있는 새로운 속성들이 추가되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;함수 특수화 (Function specialization):&lt;/b&gt;&amp;nbsp;@specialize를 사용해 일반적인 구체 타입에 대한 사전 특수화된 generic API 구현을 제공할 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;인라이닝 (Inlining):&lt;/b&gt;&amp;nbsp;@inline(always)를 통해 함수에 대한 직접 호출의 인라이닝을 보장합니다. 인라이닝이란 함수 호출부에 함수 본문을 펼치는 컴파일러 최적화인데요, 인라이닝의 이점이 코드 크기 증가보다 크다고 판단될 때만 사용하는 걸 권장합니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;함수 구현 가시성 (Function implementation visibility):&lt;/b&gt;&amp;nbsp;@export(implementation)을 사용해 ABI 안정 라이브러리의 함수 구현을 클라이언트에 노출시킬 수 있습니다. 이를 통해 함수가 더 많은 컴파일러 최적화에 참여할 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;패키지 및 빌드 개선사항&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3에서는 &lt;b&gt;Swift Package Manager에&amp;nbsp;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://github.com/swiftlang/swift-build&quot;&gt;Swift Build&lt;/a&gt;의 프리뷰가 통합&lt;/b&gt;되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 프리뷰는 지원되는 모든 플랫폼에서 통합 빌드 엔진을 제공해, 크로스 플랫폼 개발 경험을 더 일관되게 만들어줍니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;그 외 Swift Package Manager 개선사항들은 다음과 같습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;공유 매크로 라이브러리를 위한 사전 빌드된 Swift Syntax:&lt;/b&gt;&amp;nbsp;매크로에서만 사용하는 라이브러리에서 swift-syntax 사전 빌드 바이너리를 지원하면서, 공유 매크로 구현 코드를 라이브러리로 분리할 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;유연한 상속 문서 (Flexible inherited documentation):&lt;/b&gt;&amp;nbsp;심볼 그래프를 생성하는 커맨드 플러그인에 상속된 문서를 포함할지 여부를 제어할 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;패키지 트레이트 탐색 (Discoverable package traits):&lt;/b&gt;&amp;nbsp;새로운&amp;nbsp;swift package show-traits&amp;nbsp;명령어로 패키지가 지원하는 트레이트를 탐색할 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;코어 라이브러리 업데이트&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Swift Testing&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift Testing에 경고 이슈, 테스트 취소, 이미지 첨부 등 여러 개선사항이 추가되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;경고 이슈 (Warning issues):&lt;/b&gt;&amp;nbsp;Issue.record의 새로운&amp;nbsp;severity&amp;nbsp;파라미터를 사용해 테스트 이슈의 심각도를 지정할 수 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Issue.record(&quot;Something suspicious happened&quot;, severity: .warning)처럼 이슈를 경고로 기록할 수 있고, 이는 테스트 결과에 반영되지만 테스트를 실패로 표시하지는 않습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;테스트 취소 (Test cancellation):&lt;/b&gt;&amp;nbsp;try Test.cancel()을 사용해 시작된 테스트(및 그 태스크 계층)를 취소할 수 있습니다. 파라미터화된 테스트의 개별 인수를 건너뛰거나, 테스트 중 계속 진행하면 안 된다는 조건을 감지했을 때 유용합니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;이미지 첨부 (Image attachments):&lt;/b&gt;&amp;nbsp;Apple 및 Windows 플랫폼에서 테스트 중에 일반적인 이미지 타입을 첨부할 수 있습니다. UIKit 등의 UI 프레임워크와의 새로운 크로스-import 오버레이 모듈을 통해 제공됩니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;DocC&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3에서는 DocC에 세 가지 실험적 기능이 추가되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Markdown 출력:&lt;/b&gt;&amp;nbsp;표준 렌더링 JSON과 함께 문서 페이지의 Markdown 버전을 생성할 수 있습니다.&amp;nbsp;docc convert에&amp;nbsp;--enable-experimental-markdown-output&amp;nbsp;플래그를 전달하면 사용해볼 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;페이지별 정적 HTML 콘텐츠:&lt;/b&gt;&amp;nbsp;각 페이지의 경량 HTML 요약(제목, 설명, 가용성, 선언, 토론 포함)을&amp;nbsp;&amp;lt;noscript&amp;gt;&amp;nbsp;태그 안에 index.html 파일에 직접 내장할 수 있습니다. JavaScript 없이도 검색 엔진 탐색과 스크린 리더 접근성이 향상됩니다.&amp;nbsp;docc convert에&amp;nbsp;--transform-for-static-hosting --experimental-transform-for-static-hosting-with-content를 전달하면 사용해볼 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;코드 블록 어노테이션:&lt;/b&gt;&amp;nbsp;코드 블록에 새로운 포맷팅 어노테이션이 추가됩니다. 여는 펜스 라인에서 언어 이름 뒤에 콤마로 구분된 목록으로 옵션을 지정합니다:&lt;/span&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;nocopy: 클립보드 복사 비활성화&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;highlight: 특정 라인 번호 강조&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;showLineNumbers: 라인 번호 표시&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;wrap: 컬럼 너비에 따라 긴 줄 줄바꿈&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;swift&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;```swift, nocopy
let config = loadDefaultConfig()
```&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;swift&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt; ```swift, highlight=[1, 3]
let name = &quot;World&quot;       // highlighted
let greeting = &quot;Hello&quot;
print(&quot;\(greeting), \(name)!&quot;)  // highlighted
```&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;swift&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;```swift, showLineNumbers, wrap=80
func example() { /* ... */ }
```&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;DocC는 라인 인덱스의 유효성을 검사하고 인식되지 않는 옵션에 대해 경고를 표시합니다.&lt;br /&gt;--enable-experimental-code-block-annotations로 사용해볼 수 있습니다.&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;플랫폼 및 환경&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Embedded Swift&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3에서 Embedded Swift는 굉장히 다양한 개선사항을 받았습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;향상된 C 상호운용성, 더 나은 디버깅 지원, 완전한 링크 모델을 향한 의미있는 진전까지 포함됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;자세한 내용은&amp;nbsp;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://www.swift.org/blog/embedded-swift-improvements-coming-in-swift-6.3/&quot;&gt;Embedded Swift Improvements coming in Swift 6.3&lt;/a&gt;&amp;nbsp;포스팅에서 확인하실 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;hr data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Android&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3에는&amp;nbsp;&lt;b&gt;Swift SDK for Android의 첫 번째 공식 릴리즈&lt;/b&gt;가 포함되었습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 SDK를 통해 할 수 있는 것들은 다음과 같습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift로 네이티브 Android 프로그램 개발 시작&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 패키지가 Android 빌드를 지원하도록 업데이트&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://github.com/swiftlang/swift-java&quot;&gt;Swift Java&lt;/a&gt;&amp;nbsp;및&amp;nbsp;&lt;a style=&quot;color: #000000;&quot; href=&quot;https://github.com/swiftlang/swift-java-jni-core&quot;&gt;Swift Java JNI Core&lt;/a&gt;를 사용해 Kotlin/Java로 작성된 기존 Android 앱에 Swift 코드 통합&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 릴리즈는 Swift의 크로스 플랫폼 개발 가능성을 크게 열어주는 중요한 이정표라고 볼 수 있습니다!&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;시작하려면&amp;nbsp;&lt;a href=&quot;https://www.swift.org/documentation/articles/swift-sdk-for-android-getting-started.html&quot;&gt;Getting Started with the Swift SDK for Android&lt;/a&gt;&amp;nbsp;문서를 참고해보세요.&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 6.3은 언어 자체의 표현력을 높이는 동시에, 플랫폼 확장성이라는 측면에서도 굉장히 의미있는 릴리즈입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;@c&amp;nbsp;속성을 통한 C 상호운용성 강화, module name selectors를 통한 명확한 API 구분, Swift Testing의 실용적인 개선, 그리고 DocC 실험 기능들까지 &amp;mdash; 개발 경험 전반에서 체감할 수 있는 변화들이 많이 담겨있거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;무엇보다 Swift SDK for Android의 공식 릴리즈는 Swift가 단순히 Apple 생태계를 넘어 더 넓은 영역으로 뻗어나가고 있다는 신호로 보입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;Swift 6.3은 지금 바로 사용해볼 수 있습니다.&amp;nbsp;&lt;a href=&quot;https://www.swift.org/install/&quot;&gt;Install Swift&lt;/a&gt;&amp;nbsp;페이지에서 Swift 6.3 툴체인 설치 방법을 확인해보세요!&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1774742286099&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;Swift 6.3 Released&quot; data-og-description=&quot;Swift is designed to be the language you reach for at every layer of the software stack. Whether you&amp;rsquo;re building embedded firmware, internet-scale services, or full-featured mobile apps, Swift delivers strong safety guarantees, performance control when y&quot; data-og-host=&quot;www.swift.org&quot; data-og-source-url=&quot;https://www.swift.org/blog/swift-6.3-released/&quot; data-og-url=&quot;https://swift.org/blog/swift-6.3-released/&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/c6Hb1z/dJMb9eTPA6z/OuRMolpthjhUrfAU2yYvaK/img.png?width=180&amp;amp;height=180&amp;amp;face=0_0_180_180,https://scrap.kakaocdn.net/dn/cgqNWF/dJMb9b3RYyN/LfjhZr9eGvI5yb6TfBKQU0/img.jpg?width=1760&amp;amp;height=764&amp;amp;face=0_0_1760_764,https://scrap.kakaocdn.net/dn/bOYtfC/dJMb9kmcHkW/xKfkEfVmyq6RhxSPkyP410/img.jpg?width=1760&amp;amp;height=764&amp;amp;face=0_0_1760_764&quot;&gt;&lt;a href=&quot;https://www.swift.org/blog/swift-6.3-released/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://www.swift.org/blog/swift-6.3-released/&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/c6Hb1z/dJMb9eTPA6z/OuRMolpthjhUrfAU2yYvaK/img.png?width=180&amp;amp;height=180&amp;amp;face=0_0_180_180,https://scrap.kakaocdn.net/dn/cgqNWF/dJMb9b3RYyN/LfjhZr9eGvI5yb6TfBKQU0/img.jpg?width=1760&amp;amp;height=764&amp;amp;face=0_0_1760_764,https://scrap.kakaocdn.net/dn/bOYtfC/dJMb9kmcHkW/xKfkEfVmyq6RhxSPkyP410/img.jpg?width=1760&amp;amp;height=764&amp;amp;face=0_0_1760_764');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;Swift 6.3 Released&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Swift is designed to be the language you reach for at every layer of the software stack. Whether you&amp;rsquo;re building embedded firmware, internet-scale services, or full-featured mobile apps, Swift delivers strong safety guarantees, performance control when y&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>Apple</category>
      <category>ios</category>
      <category>SWIFT</category>
      <category>Swift 6.3</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/614</guid>
      <comments>https://green1229.tistory.com/614#entry614comment</comments>
      <pubDate>Sun, 29 Mar 2026 08:58:54 +0900</pubDate>
    </item>
    <item>
      <title>Swift 6.2.4</title>
      <link>https://green1229.tistory.com/613</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #000000;&quot;&gt;Swift 6.2.4에서 릴리즈된 내용&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;들을 정리해보겠습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/zRAly/dJMcagrje1t/OaDdeZcRHKUUk4qAKh8AH0/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/zRAly/dJMcagrje1t/OaDdeZcRHKUUk4qAKh8AH0/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/zRAly/dJMcagrje1t/OaDdeZcRHKUUk4qAKh8AH0/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FzRAly%2FdJMcagrje1t%2FOaDdeZcRHKUUk4qAKh8AH0%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;2026년 2월 27일, Swift 6.2.4가 공식 릴리즈되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;이번 릴리즈는 &lt;b&gt;주로 버그 수정과 성능 개선에 초점을 맞춘 마이너 업데이트&lt;/b&gt;입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;Xcode 26.3에 Swift 6.2.4가 포함되어 있으며, Swiftly나 Docker를 통해서도 설치할 수 있습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;설치 방법&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Swiftly 사용&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;pre class=&quot;bash&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;bash&quot;&gt;&lt;code&gt;swiftly install 6.2.4
# 또는
swiftly install latest&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;직접 다운로드&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;a href=&quot;http://swift.org/install&quot;&gt;Swift.org&lt;/a&gt;에서 툴체인을 직접 다운로드할 수 있습니다.&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Docker&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;Docker 이미지는 곧&amp;nbsp;&lt;a href=&quot;http://hub.docker.com/_/swift&quot;&gt;hub.docker.com/_/swift&lt;/a&gt;에서 사용 가능합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Xcode&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Xcode 26.3&lt;/b&gt;에 Swift 6.2.4가 포함되어 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;주요 변경사항&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Swift 컴파일러&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;1. for-in 루프의 break/continue 크래시 수정&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;PR:&amp;nbsp;&lt;a href=&quot;https://github.com/swiftlang/swift/pull/86114&quot;&gt;#86114&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;variadic generic 타입을 순회하는&amp;nbsp;for-in&amp;nbsp;루프에서&amp;nbsp;continue나&amp;nbsp;break&amp;nbsp;문을 사용할 때 런타임 크래시가 발생할 수 있는 문제를 수정했습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;컴파일러가 잘못된 jump destination을 선택하는 버그였습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// 이제 정상적으로 동작합니다
for element in packExpansion {
    if someCondition {
        continue // 또는 break
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;관련 이슈: &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift/issues/78598&quot;&gt;Runtime crash (BAD_ACCESS) when iterating over a generic pack (tuple) #78598&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;2. nonisolated(nonsending) isolation 전달 개선&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;PR:&amp;nbsp;&lt;a href=&quot;https://github.com/swiftlang/swift/pull/86112&quot;&gt;#86112&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;nonisolated(nonsending)&amp;nbsp;isolation이 이제 parent isolation을 가정하지 않는 closure로 전달됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;특히&amp;nbsp;@Sendable&amp;nbsp;파라미터로 전달되는 closure에서 불필요한 isolation switch를 피할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@MainActor func test(_: nonisolated(nonsending) @Sendable () async -&amp;gt; Void) async {}

await test {
    // The closure doesn't leave `@MainActor`.
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;이전에는 이런 closure가&amp;nbsp;@MainActor를 벗어났다가 다시 들어오는 불필요한 isolation switch가 발생했지만, 이제는&amp;nbsp;@MainActor를 유지합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr data-ke-style=&quot;style1&quot; /&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Swift Package Manager&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;1. 대량 소스 파일 선언 시 성능 개선&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;많은 수의 소스 파일을 명시적으로 선언하는 target을 빌드하거나 의존할 때 성능이 크게 개선되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;관련 이슈:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://github.com/swiftlang/swift-package-manager/issues/9304&quot;&gt;Explicit source file declaration in Target's sources causes a performance degradation #9304&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;배경: &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;swift-protobuf&amp;nbsp;1.33.1에서 모든 소스 파일을 명시적으로 선언하도록 변경했는데, 이로 인해 빌드 성능이 크게 저하되는 문제가 있었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;SwiftPM이 각 파일에 대해 다른 모든 파일의 subpath인지 확인하는 O(n&amp;sup2;) 연산을 수행했기 때문입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;이번 릴리즈에서 이 부분이 최적화되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;2. 의존성 체인의 default traits 처리 개선&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;의존성 체인 전반에서 default traits가 올바르게 활성화되도록 처리가 개선되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;관련 이슈:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://github.com/swiftlang/swift-package-manager/issues/9286&quot;&gt;Package with enabled traits in dependency chain fails to resolve #9286&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr data-ke-style=&quot;style1&quot; /&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;swift-corelibs-foundation&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;NSString의 buffer overflow 수정&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;PR:&amp;nbsp;&lt;a href=&quot;https://github.com/swiftlang/swift-corelibs-foundation/pull/5287&quot;&gt;#5287&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;NSString의&amp;nbsp;getBytes&amp;nbsp;메서드에서 buffer overflow가 발생할 수 있는 심각한 버그를 수정했습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;문제: &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;_NSCFString.getBytes가 제공된 max buffer length를 읽거나 존중하지 않아서, 충분하지 않은 크기의 buffer가 제공되면 buffer overflow가 발생했습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;특히&amp;nbsp;plutil에서 긴 유니코드 문자열이 포함된 plist를 읽을 때 증상이 나타났습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;UTF16 count는 stack buffer를 사용할 만큼 작았지만, UTF8 count는 충분히 커서 stack buffer를 overflow시켰습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;해결: &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;이제 byte iteration 중 max buffer length에 도달하면 중단하도록 개선된 bounds checking이 추가되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;관련 이슈:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://github.com/swiftlang/swift-corelibs-foundation/issues/5284&quot;&gt;Segmentation fault when Linux plutil tries to convert a single non-ascii string #5284&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr data-ke-style=&quot;style1&quot; /&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;swift-format&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;nonisolated(nonsending) 포맷팅 수정&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;PR:&amp;nbsp;&lt;a href=&quot;https://github.com/swiftlang/swift-format/pull/1124&quot;&gt;#1124&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;nonisolated(nonsending)&amp;nbsp;type modifier가 이제 올바르게 포맷팅됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// 이제 제대로 포맷팅됩니다
func example(_: nonisolated(nonsending) @Sendable () async -&amp;gt; Void) async {
    // ...
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;위험도 평가&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;모든 변경사항은&amp;nbsp;&lt;b&gt;Low Risk&lt;/b&gt;로 평가되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;for-in 크래시 수정&lt;/b&gt;: variadic generic을 순회하는 루프 내부의 break/continue에만 영향&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;nonisolated(nonsending) 전달&lt;/b&gt;:&amp;nbsp;@Sendable&amp;nbsp;파라미터이면서&amp;nbsp;nonisolated(nonsending)인 isolation boundary closure에만 영향&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;SPM 성능&lt;/b&gt;: 명시적으로 선언된 소스 파일이 많은 경우에만 해당&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;NSString 수정&lt;/b&gt;: buffer overflow 취약점 수정으로 안정성 향상&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;Swift 6.2.4는 크리티컬한 버그 수정과 성능 개선을 포함한 안정화 릴리즈&lt;/b&gt;입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;특히 NSString의 buffer overflow 수정은 보안 측면에서 중요한 개선이고, SPM의 성능 개선은 대규모 프로젝트에서 체감할 수 있을 것 같습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;nonisolated(nonsending)의 isolation 전달 개선도 Swift Concurrency를 사용하는 코드의 성능을 향상시켜줄 것으로 기대됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;Xcode 26.3을 사용하고 계시다면 이미 Swift 6.2.4를 사용하고 계신 거니, 별도로 업데이트할 필요는 없습니다  &lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1774130730591&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;Announcing Swift 6.2.4&quot; data-og-description=&quot;We are happy to announce the release of Swift 6.2.4. Install Swift Toolchain Install via Swiftly swiftly install 6.2.4 or swiftly install latest Download toolchain directly from Install Swift | Swift.org Docker images will be available on hub.docker.com/_/&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/announcing-swift-6-2-4/85050&quot; data-og-url=&quot;https://forums.swift.org/t/announcing-swift-6-2-4/85050&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bZmRUR/dJMb8Qeluhd/3pNMvPVGSbLUIbsvyyoG50/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cTSvNx/dJMb8Qeluhc/k17gA8ARukRF5L8BnUY6d1/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/announcing-swift-6-2-4/85050&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/announcing-swift-6-2-4/85050&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bZmRUR/dJMb8Qeluhd/3pNMvPVGSbLUIbsvyyoG50/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cTSvNx/dJMb8Qeluhc/k17gA8ARukRF5L8BnUY6d1/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;Announcing Swift 6.2.4&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;We are happy to announce the release of Swift 6.2.4. Install Swift Toolchain Install via Swiftly swiftly install 6.2.4 or swiftly install latest Download toolchain directly from Install Swift | Swift.org Docker images will be available on hub.docker.com/_/&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1774130733904&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;Swift.org&quot; data-og-description=&quot;Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.&quot; data-og-host=&quot;www.swift.org&quot; data-og-source-url=&quot;http://swift.org/install&quot; data-og-url=&quot;https://swift.org&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bglegR/dJMb9dHnnmN/JUomC0jc2shjWwDaeD22d0/img.png?width=180&amp;amp;height=180&amp;amp;face=0_0_180_180&quot;&gt;&lt;a href=&quot;http://swift.org/install&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;http://swift.org/install&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bglegR/dJMb9dHnnmN/JUomC0jc2shjWwDaeD22d0/img.png?width=180&amp;amp;height=180&amp;amp;face=0_0_180_180');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;Swift.org&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1774130732814&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;swift - Official Image | Docker Hub&quot; data-og-description=&quot;Docker Official Images are a curated set of Docker open source and drop-in solution repositories. Why Official Images? These images have clear documentation, promote best practices, and are designed for the most common use cases.&quot; data-og-host=&quot;hub.docker.com:443&quot; data-og-source-url=&quot;http://hub.docker.com/_/swift&quot; data-og-url=&quot;https://hub.docker.com:443/_/swift&quot; data-og-image=&quot;&quot;&gt;&lt;a href=&quot;http://hub.docker.com/_/swift&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;http://hub.docker.com/_/swift&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url();&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift - Official Image | Docker Hub&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Docker Official Images are a curated set of Docker open source and drop-in solution repositories. Why Official Images? These images have clear documentation, promote best practices, and are designed for the most common use cases.&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;hub.docker.com:443&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>ios</category>
      <category>SWIFT</category>
      <category>Swift 6.2.4</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/613</guid>
      <comments>https://green1229.tistory.com/613#entry613comment</comments>
      <pubDate>Sun, 22 Mar 2026 07:06:59 +0900</pubDate>
    </item>
    <item>
      <title>[SE-0515] Allow reduce to produce noncopyable results</title>
      <link>https://green1229.tistory.com/612</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;SE-0515 Allow reduce to produce noncopyable results&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bnwJAN/dJMcaaq0IDg/6JsTRObklbYLkODPCREjcK/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bnwJAN/dJMcaaq0IDg/6JsTRObklbYLkODPCREjcK/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bnwJAN/dJMcaaq0IDg/6JsTRObklbYLkODPCREjcK/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbnwJAN%2FdJMcaaq0IDg%2F6JsTRObklbYLkODPCREjcK%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift의&amp;nbsp;reduce는 정말 유용한 함수이지만, 몇 가지 한계가 있었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;noncopyable 타입을 다룰 수 없었고, initial value를 borrow하는 방식이라 불필요한 복사가 발생했어요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;SE-0515는&amp;nbsp;reduce를 개선합니다  &lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Noncopyable initial value와 result를 허용하고&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Copyable일 때도 initial value를 consume하도록 변경합니다&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR'; color: #000000;&quot;&gt;이미 PR이 Accepted&amp;nbsp;상태이고 구현도 완료되었으니, 곧 현업에서도 쓸 수 있을 것 같습니다  &lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;왜 필요한가?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Noncopyable 타입은 SE-0390에서 도입되어 타입의 의미론과 성능을 제어하는 강력한 메커니즘을 제공&lt;/b&gt;합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Sequence는 (아직은) noncopyable 타입을 담을 수 없지만,&amp;nbsp;&lt;b&gt;reduce의 accumulation argument는 sequence와 독립적&lt;/b&gt;입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;따라서 initial value를 &lt;b&gt;borrow 대신 consume하면, 복사 능력에 의존하지 않고도&amp;nbsp;reduce를 구현&lt;/b&gt;할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;현재 reduce의 문제점&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR'; color: #000000;&quot;&gt;현재&amp;nbsp;reduce&amp;nbsp;구현은 parameter를&amp;nbsp;borrow합니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;func reduce&amp;lt;Result&amp;gt;(
  _ initialResult: Result,
  _ nextPartialResult:
    (_ partialResult: Result, Element) throws -&amp;gt; Result
) rethrows -&amp;gt; Result {
  var accumulator = initialResult
  for element in self {
    accumulator = try nextPartialResult(accumulator, element)
  }
  return accumulator
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;여기서 borrow는 암묵적입니다. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;initializer가 아닌 argument의 기본값이니까요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;그래서 문제가..?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic';&quot;&gt;첫 단계가 항상&amp;nbsp;initialResult의 mutable copy를 만드는 겁니다.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;var accumulator = initialResult  // 복사 발생!&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 패턴은 initial의 올바른 calling convention이 consuming이어야 한다는 걸 강하게 암시합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;만약 값이 copyable이면,&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;호출자가 복사를 만듭니다&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;단, optimizer가 마지막 사용임을 확인하면 복사를 완전히 제거할 수 있습니다&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR'; color: #000000;&quot;&gt;이런 경우는&amp;nbsp;reduce에서 매우 흔합니다. &quot;initial value&quot;가 종종 reduction만을 위해 생성되니까요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;솔루션&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;reduce를 noncopyable 값에서도 동작하도록 일반화하면, initial value를 consume하는 게&amp;nbsp;&lt;b&gt;필수&lt;/b&gt;가 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;var accumulator = initialResult가 더 이상 컴파일되지 않으니까요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR'; color: #000000;&quot;&gt;즉, 새 버전의&amp;nbsp;reduce는 이렇게 작성됩니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Sequence {
  public func reduce&amp;lt;Result: ~Copyable&amp;gt;(
    _ initialResult: consuming Result,
    _ nextPartialResult:
      (_ partialResult: consuming Result, Element) throws -&amp;gt; Result
  ) rethrows -&amp;gt; Result

  public func reduce&amp;lt;Result: ~Copyable&amp;gt;(
    into initialResult: consuming Result,
    _ updateAccumulatingResult:
      (_ partialResult: inout Result, Element) throws -&amp;gt; ()
  ) rethrows -&amp;gt; Result
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;실제 구현&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot;&gt;&lt;code&gt;public func reduce&amp;lt;Result: ~Copyable&amp;gt;(
  _ initialResult: consuming Result,
  _ nextPartialResult:
    (_ partialResult: consuming Result, Element) throws -&amp;gt; Result
) rethrows -&amp;gt; Result {
  for element in self {
    initialResult = try nextPartialResult(initialResult, element)
  }
  return initialResult
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR'; color: #000000;&quot;&gt;더 이상&amp;nbsp;initialResult&amp;nbsp;값을 복사할 필요가 없습니다.&amp;nbsp;consuming(즉, owned not borrowed)으로 받으니까요!&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;reduce(::)와 reduce(into:_:)의 차이&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 시점에서 두 함수는 거의 동일해지고,&amp;nbsp;reduce(into:_:)의 동기가 줄어듭니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;어떤 걸 쓸지는 주로 개발자&lt;b&gt;&amp;nbsp;선택&lt;/b&gt;의 문제가 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;성능 개선&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;&quot;세계에서 가장 느린 map&quot; 문제&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 변경은 고전적인 세 가지 원인 중 하나를 제거합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;array.reduce([]) { $0 + [$1] }&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이건 여전히 O(n&amp;sup2;)입니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;+가 argument를 borrow하고 모든 element를 복사한 새 array를 반환&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;[$1]이 버릴 거면서도 새 array buffer를 할당&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 새 reduce로는 이렇게 쓸 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;array.reduce([]) { $0.append($1); return $0 }&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이제 다음과 같은 성능을 얻습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;array.reduce(into: []) { $0.append($1) }&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;약간은 더 reduce(into:_:)와 동일한 성능이죠!&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;주의사항&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;물론 이런 모든 비효율성은 optimizer가 heroic optimization을 수행하면 제거될 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 이런&lt;b&gt; heroic optimization은 조금만 복잡한 예시에서는 무너지는 경향이 있어서, 성능 절벽으로 이어집니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;reduce(into:_:)는?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;reduce(into:_:)는 이미 argument를 consuming으로 받습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;따라서 유일한 변경은&amp;nbsp;Result: ~Copyable&amp;nbsp;추가뿐입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;향후 방향&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;~Escapable 지원&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;reduce는&amp;nbsp;~Escapable&amp;nbsp;값에서도 동작하도록 업데이트될 수 있습니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이를 위해서는 함수와 closure parameter 모두에 lifetime annotation이 필요한데, 후자는 Swift에서 아직 지원되지 않습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;SE-0515는 이미&amp;nbsp;&lt;b&gt;Accepted&lt;/b&gt;되었고 구현도 완료된 상태입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;개인적으로는 정말 합리적인 개선이라고 생각합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;reduce가 initial value를 borrow하는 건 원래부터 이상했어요. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;첫 줄에서 바로 복사하는데 말이죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이제 noncopyable 타입도 지원하고, copyable 타입에서도 불필요한 복사를 줄일 수 있게 되었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;&quot;세계에서 가장 느린 map&quot; 같은 실수도 조금 덜 치명적으로 만들어주는 좋은 변경이네요  &lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1773441442058&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;object&quot; data-og-title=&quot;swift-evolution/proposals/0515-noncopyable-reduce.md at main &amp;middot; swiftlang/swift-evolution&quot; data-og-description=&quot;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&quot; data-og-host=&quot;github.com&quot; data-og-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0515-noncopyable-reduce.md&quot; data-og-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0515-noncopyable-reduce.md&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bfJK2w/dJMb84XXjzL/gzj5D4GykeRsuWl97tGsS0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/dkSYOC/dJMb81GVMMq/i5M85e1kvbIWkz76BlVA9K/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0515-noncopyable-reduce.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0515-noncopyable-reduce.md&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bfJK2w/dJMb84XXjzL/gzj5D4GykeRsuWl97tGsS0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/dkSYOC/dJMb81GVMMq/i5M85e1kvbIWkz76BlVA9K/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift-evolution/proposals/0515-noncopyable-reduce.md at main &amp;middot; swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;github.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1773441443558&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;[Pitch] Allow &amp;#96;reduce&amp;#96; to produce noncopyable results&quot; data-og-description=&quot;Hi Swift Evolution, It is obligatory that I doom this pitch as possibly the least controversial pitch I can think of. Allow reduce to produce noncopyable results Proposal: SE-NNNN Authors: Ben Cohen Review Manager: TBD Status: Awaiting implementation or Aw&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/pitch-allow-reduce-to-produce-noncopyable-results/84073&quot; data-og-url=&quot;https://forums.swift.org/t/pitch-allow-reduce-to-produce-noncopyable-results/84073&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/hG9jL/dJMb9efcvm0/zo8esEqw6XPZPC21OAvyzK/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/jQAly/dJMb9bv0RMZ/lKgz1rcgdHfDAOpHhOEsck/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/pitch-allow-reduce-to-produce-noncopyable-results/84073&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/pitch-allow-reduce-to-produce-noncopyable-results/84073&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/hG9jL/dJMb9efcvm0/zo8esEqw6XPZPC21OAvyzK/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/jQAly/dJMb9bv0RMZ/lKgz1rcgdHfDAOpHhOEsck/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;[Pitch] Allow `reduce` to produce noncopyable results&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hi Swift Evolution, It is obligatory that I doom this pitch as possibly the least controversial pitch I can think of. Allow reduce to produce noncopyable results Proposal: SE-NNNN Authors: Ben Cohen Review Manager: TBD Status: Awaiting implementation or Aw&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1773441444386&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;SE-0515: Allow &amp;#96;reduce&amp;#96; to produce noncopyable results&quot; data-og-description=&quot;Hi everybody. The review of SE-0515: Allow reduce to produce noncopyable results begins now and runs through March 10, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you &quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/se-0515-allow-reduce-to-produce-noncopyable-results/84997&quot; data-og-url=&quot;https://forums.swift.org/t/se-0515-allow-reduce-to-produce-noncopyable-results/84997&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/rXP5X/dJMb9bv0RM0/wjhIOQMxVpQYATZe6bj6p1/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/NNLF8/dJMb9efcvm1/EKgKr7j5DU7KFuDsCk4q9K/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/se-0515-allow-reduce-to-produce-noncopyable-results/84997&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/se-0515-allow-reduce-to-produce-noncopyable-results/84997&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/rXP5X/dJMb9bv0RM0/wjhIOQMxVpQYATZe6bj6p1/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/NNLF8/dJMb9efcvm1/EKgKr7j5DU7KFuDsCk4q9K/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;SE-0515: Allow `reduce` to produce noncopyable results&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hi everybody. The review of SE-0515: Allow reduce to produce noncopyable results begins now and runs through March 10, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1773441446228&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;[Accepted] SE-0515: Allow &amp;#96;reduce&amp;#96; to produce noncopyable results&quot; data-og-description=&quot;The review of SE-0515: Allow reduce to produce noncopyable results has ended, and the Language Steering Group has decided to accept the proposal. There was unanimous support for what the community sees as an obvious generalization of the existing reduce AP&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/accepted-se-0515-allow-reduce-to-produce-noncopyable-results/85286&quot; data-og-url=&quot;https://forums.swift.org/t/accepted-se-0515-allow-reduce-to-produce-noncopyable-results/85286&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/ds5Bad/dJMb81fRbyn/Pj8KPeGFyNoI55bKDTilVk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bjYdjt/dJMb87NUYBx/H85zmvOdJkd5CUAKx8KoS0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/accepted-se-0515-allow-reduce-to-produce-noncopyable-results/85286&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/accepted-se-0515-allow-reduce-to-produce-noncopyable-results/85286&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/ds5Bad/dJMb81fRbyn/Pj8KPeGFyNoI55bKDTilVk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bjYdjt/dJMb87NUYBx/H85zmvOdJkd5CUAKx8KoS0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;[Accepted] SE-0515: Allow `reduce` to produce noncopyable results&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;The review of SE-0515: Allow reduce to produce noncopyable results has ended, and the Language Steering Group has decided to accept the proposal. There was unanimous support for what the community sees as an obvious generalization of the existing reduce AP&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>ios</category>
      <category>reduce</category>
      <category>SE-0515</category>
      <category>SWIFT</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/612</guid>
      <comments>https://green1229.tistory.com/612#entry612comment</comments>
      <pubDate>Sat, 14 Mar 2026 07:40:20 +0900</pubDate>
    </item>
    <item>
      <title>[SE-0514] Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection</title>
      <link>https://green1229.tistory.com/611</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;SE-0514 Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/q7EvU/dJMcah4BjPA/M5SZwiKaeRVjxP8lN09oK1/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/q7EvU/dJMcah4BjPA/M5SZwiKaeRVjxP8lN09oK1/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/q7EvU/dJMcah4BjPA/M5SZwiKaeRVjxP8lN09oK1/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fq7EvU%2FdJMcah4BjPA%2FM5SZwiKaeRVjxP8lN09oK1%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 표준 라이브러리의 몇몇 &lt;b&gt;collection 타입들이&amp;nbsp;Hashable을 conform하지 않는 게 있습니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Dictionary.Keys,&amp;nbsp;CollectionOfOne,&amp;nbsp;EmptyCollection&lt;/b&gt;이 바로 그것들인데요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;이번 SE-0514는 이 세 타입에&amp;nbsp;Hashable&amp;nbsp;conformance를 추가하는 제안입니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;특히&amp;nbsp;Dictionary.Keys는 모든 key가 이미&amp;nbsp;Hashable인데 keys view 자체는&amp;nbsp;Hashable이 아닌 게 좀 이상하죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;간단하지만 일관성을 높여주는 개선입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;현재 2026년 3월 6일까지 리뷰가 진행 중입니다!&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;왜 필요한가?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Dictionary.Keys&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary.Keys는 단순히 dictionary의 keys에 대한 view입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary의 모든 key는&amp;nbsp;Hashable을 conform하죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;따라서&amp;nbsp;Dictionary.Keys&amp;nbsp;자체도 자동으로 그리고 무조건적으로&amp;nbsp;Hashable을 conform해야 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;CollectionOfOne과 EmptyCollection&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;CollectionOfOne과&amp;nbsp;EmptyCollection은 상대적으로 덜 사용되는 타입들입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이들에&amp;nbsp;Hashable&amp;nbsp;conformance를 추가하는 건 완전성과 다른 표준 라이브러리 collection 타입들과의 일관성을 위해서입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;참고로&amp;nbsp;CollectionOfOne은&amp;nbsp;Equatable도 conform하지 않아서, 이 제안에서는 그것도 함께 추가합니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;솔루션&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;표준 라이브러리에 다음을 추가합니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary.Keys와&amp;nbsp;EmptyCollection: 무조건적&amp;nbsp;Hashable&amp;nbsp;conformance&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;CollectionOfOne: 조건부&amp;nbsp;Equatable과&amp;nbsp;Hashable&amp;nbsp;conformance&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;상세 설계&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Dictionary.Keys&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary.Keys는 무조건적인&amp;nbsp;Hashable&amp;nbsp;conformance를 얻습니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary의 key는 항상&amp;nbsp;Hashable이니까요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Hash 구현은&amp;nbsp;&lt;b&gt;commutative hashing algorithm&lt;/b&gt;(개별 element hash의 XOR)을 사용해서, 두&amp;nbsp;Dictionary.Keys&amp;nbsp;collection이 같은 element를 포함하면 iteration order와 관계없이 같은 hash value를 갖도록 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Dictionary.Keys {
  @_alwaysEmitIntoClient
  public func hash(into hasher: inout Hasher) {
    var commutativeHash = 0
    for element in self {
      // Note that, similar to `Set`'s and `Dictionary`'s hashing algorithms, we use a copy of our own hasher here.
      // This makes hash values dependent on its state, eliminating static collision patterns.
      var elementHasher = hasher
      elementHasher.combine(element)
      commutativeHash ^= elementHasher._finalize()
    }
    hasher.combine(commutativeHash)
  }

  @_alwaysEmitIntoClient
  public var hashValue: Int { // Prevent compiler from synthesizing hashValue.
    var hasher = Hasher()
    self.hash(into: &amp;amp;hasher)
    return hasher.finalize()
  }
}

@available(SwiftStdlib 6.4, *)
extension Dictionary.Keys: Hashable {}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;사용 예시&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let batch1 = [&quot;apple&quot;: 1, &quot;banana&quot;: 2, &quot;cherry&quot;: 3, &quot;date&quot;: 4]
let batch2 = [&quot;date&quot;: 10, &quot;banana&quot;: 20, &quot;apple&quot;: 30, &quot;cherry&quot;: 40]
let batch3 = [&quot;mango&quot;: 5, &quot;orange&quot;: 6, &quot;papaya&quot;: 7]

let uniqueBatches = Set([batch1.keys, batch2.keys, batch3.keys])

print(uniqueBatches)
// [Dictionary.Keys([&quot;orange&quot;, &quot;mango&quot;, &quot;papaya&quot;]), Dictionary.Keys([&quot;banana&quot;, &quot;apple&quot;, &quot;date&quot;, &quot;cherry&quot;])]&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;batch1.keys와 batch2.keys는 같은 key들을 포함하므로 Set에서 하나로 처리됩니다!&lt;/span&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;CollectionOfOne&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;CollectionOfOne은 조건부 conformance를 얻습니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Element가&amp;nbsp;Equatable이면&amp;nbsp;Equatable&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Element가&amp;nbsp;Hashable이면&amp;nbsp;Hashable&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;Hash value는 포함하고 있는 단일 element에서 파생됩니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension CollectionOfOne where Element: Equatable {
  @_alwaysEmitIntoClient
  public static func ==(lhs: CollectionOfOne&amp;lt;Element&amp;gt;, rhs: CollectionOfOne&amp;lt;Element&amp;gt;) -&amp;gt; Bool {
    return lhs._element == rhs._element
  }
}

extension CollectionOfOne where Element: Hashable {
  @_alwaysEmitIntoClient
  public func hash(into hasher: inout Hasher) {
    hasher.combine(self._element)
  }

  @_alwaysEmitIntoClient
  public var hashValue: Int { // Prevent compiler from synthesizing hashValue.
    var hasher = Hasher()
    self.hash(into: &amp;amp;hasher)
    return hasher.finalize()
  }
}

@available(SwiftStdlib 6.4, *)
extension CollectionOfOne: Equatable where Element: Equatable {}

@available(SwiftStdlib 6.4, *)
extension CollectionOfOne: Hashable where Element: Hashable {}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;EmptyCollection&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;EmptyCollection은 무조건적인 Hashable conformance를 얻습니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;모든 empty collection은 element 타입과 관계없이 동일하므로, 모두 같은 hash value를 가집니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Hash 함수는 단순히 값 0을 combine하는데, 이는 empty set, dictionary, array의 hashing convention과 일치합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension EmptyCollection {
  @_alwaysEmitIntoClient
  public func hash(into hasher: inout Hasher) {
    hasher.combine(0)
  }

  @_alwaysEmitIntoClient
  public var hashValue: Int { // Prevent compiler from synthesizing hashValue.
    var hasher = Hasher()
    self.hash(into: &amp;amp;hasher)
    return hasher.finalize()
  }
}

@available(SwiftStdlib 6.4, *)
extension EmptyCollection: Hashable {}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;호환성&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Source compatibility&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;순수하게 additive한 변경입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다만 이미 자체적으로 redundant conformance를 제공한 코드는 경고가 발생할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;ABI compatibility&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;표준 라이브러리 ABI의 순수한 확장이고, 기존 기능은 변경하지 않습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Adoption 영향&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;새로운 conformance는 Swift 6.4 이상이 필요합니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이전 Swift 버전을 지원해야 한다면 이렇게 하면 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;#if swift(&amp;lt;6.4)
  extension Dictionary.Keys: @retroactive Hashable {}
#endif&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;FYI. 이전 Swift 버전에서 이미 이런 함수를 구현했다면, 런타임에 binary compatibility 이슈가 발생할 낮은 이론적 위험이 있습니다. &lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;특히 구현이 표준 라이브러리 구현과 근본적으로 호환되지 않거나 충돌하는 경우입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;고려된 대안&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;EmptyCollection의 Hashable conformance를 포함하지 않기?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;완전성과 다른 표준 라이브러리 collection 타입들과의 일관성 외에도, hash-based context에서&amp;nbsp;EmptyCollection을 사용하는 케이스는 피할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;예를 들어&amp;nbsp;result ?? EmptyCollection&amp;lt;T&amp;gt;&amp;nbsp;대신 다른 방법을 쓸 수도 있죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 그런 workaround가 해당 use case에 idiomatic하지 않을 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;그래서 일관성을 위해 포함시키기로 했습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;현재 SE-0514는 2026년 3월 6일까지 리뷰가 진행 중입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;개인적으로는 정말 당연하게 있어야 할 conformance들이라고 생각합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;특히&amp;nbsp;Dictionary.Keys는 모든 key가 이미&amp;nbsp;Hashable인데 keys view가&amp;nbsp;Hashable이 아닌 게 이상했거든요.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;CollectionOfOne과 EmptyCollection은 덜 사용되지만, 표준 라이브러리의 일관성을 높여주는 좋은 제안이라 생각됩니다  &lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1772410426331&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;object&quot; data-og-title=&quot;swift-evolution/proposals/0514-hashable-conformance-for-dictionarykeys-collectionofone-emptycollection.md at main &amp;middot; swiftlang/s&quot; data-og-description=&quot;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&quot; data-og-host=&quot;github.com&quot; data-og-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0514-hashable-conformance-for-dictionarykeys-collectionofone-emptycollection.md&quot; data-og-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0514-hashable-conformance-for-dictionarykeys-collectionofone-emptycollection.md&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bBNBFK/dJMb83Sgiok/S78Na3jpkoL3t7xkSkmgLK/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/Ml0Lv/dJMb81GUFRG/sl1hLJMZhpkxB8JTEnKVL1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0514-hashable-conformance-for-dictionarykeys-collectionofone-emptycollection.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0514-hashable-conformance-for-dictionarykeys-collectionofone-emptycollection.md&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bBNBFK/dJMb83Sgiok/S78Na3jpkoL3t7xkSkmgLK/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/Ml0Lv/dJMb81GUFRG/sl1hLJMZhpkxB8JTEnKVL1/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift-evolution/proposals/0514-hashable-conformance-for-dictionarykeys-collectionofone-emptycollection.md at main &amp;middot; swiftlang/s&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;github.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1772410429636&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;[Pitch] Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection&quot; data-og-description=&quot;Introduction This proposal adds Hashable conformance to three standard library collection types: Dictionary.Keys, CollectionOfOne and EmptyCollection. Motivation Dictionary.Keys Dictionary.Keys is simply a view of the dictionary's keys, and every key in a &quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/pitch-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84117&quot; data-og-url=&quot;https://forums.swift.org/t/pitch-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84117&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/keEaP/dJMb9aKCz7l/8qMu4NNXxnMsKKDVdkE491/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/pmgXY/dJMb8866kq3/cUgqnglJrBiNwFWjT5Icyk/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/pitch-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84117&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/pitch-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84117&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/keEaP/dJMb9aKCz7l/8qMu4NNXxnMsKKDVdkE491/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/pmgXY/dJMb8866kq3/cUgqnglJrBiNwFWjT5Icyk/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;[Pitch] Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Introduction This proposal adds Hashable conformance to three standard library collection types: Dictionary.Keys, CollectionOfOne and EmptyCollection. Motivation Dictionary.Keys Dictionary.Keys is simply a view of the dictionary's keys, and every key in a&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1772410432193&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;SE-0514: Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection&quot; data-og-description=&quot;Hello, Swift community! The review of SE-0514: Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection begins now and runs through March 6, 2026. Reviews are an important part of the Swift evolution process. All review feedback should&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/se-0514-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84852&quot; data-og-url=&quot;https://forums.swift.org/t/se-0514-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84852&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/pR4Tr/dJMb8U8Q5Ye/YbS9YzgEAr4jTHqqU72SK1/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/ECPIF/dJMb8SXveRX/MLkLhps9zFZidRrvCkKNgK/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/se-0514-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84852&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/se-0514-hashable-conformance-for-dictionary-keys-collectionofone-and-emptycollection/84852&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/pR4Tr/dJMb8U8Q5Ye/YbS9YzgEAr4jTHqqU72SK1/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/ECPIF/dJMb8SXveRX/MLkLhps9zFZidRrvCkKNgK/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;SE-0514: Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hello, Swift community! The review of SE-0514: Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection begins now and runs through March 6, 2026. Reviews are an important part of the Swift evolution process. All review feedback should&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>hashable</category>
      <category>SE-0514</category>
      <category>SWIFT</category>
      <category>Swift 6.4</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/611</guid>
      <comments>https://green1229.tistory.com/611#entry611comment</comments>
      <pubDate>Mon, 2 Mar 2026 09:14:46 +0900</pubDate>
    </item>
    <item>
      <title>[SE-0510] Introduce Dictionary.mapValuesWithKeys</title>
      <link>https://green1229.tistory.com/610</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;SE-0510 Introduce Dictionary.mapValuesWithKeys&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/EYWCM/dJMcahpTc2l/AXUpfqG4ZtKf2xJG088Rk0/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/EYWCM/dJMcahpTc2l/AXUpfqG4ZtKf2xJG088Rk0/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/EYWCM/dJMcahpTc2l/AXUpfqG4ZtKf2xJG088Rk0/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FEYWCM%2FdJMcahpTc2l%2FAXUpfqG4ZtKf2xJG088Rk0%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Intro&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;Dictionary의 값을 변환할 때 key 정보도 함께 필요한 경우가 종종 있습니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 현재는 이런 작업을 하려면&amp;nbsp;init(uniqueKeysWithValues:)나&amp;nbsp;reduce(into:)를 써야 하는데, 이들은 불필요하게 dictionary를 rehashing하거나 &lt;b&gt;재할당하는 비용이 발생합니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;SE-0510은 이 문제를 해결하기 위해&amp;nbsp;&lt;b&gt;mapValuesWithKeys라는 새로운 메서드를 제안&lt;/b&gt;합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Key 정보를 transformation closure에 전달하면서도 성능 오버헤드 없이 값만 변환할 수 있습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;현재 시점에서는 리뷰가 드래프트 상태이고 진행중이지만 곧 반영되지 않을까 싶습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;왜 필요한가?&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;Dictionary 값을 변환하면서 key도 함께 사용해야 하는 경우, 현재는 이렇게 해야 합니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let new: [Key: NewValue] = .init(
    uniqueKeysWithValues: old.lazy.map { ($0, transform(id: $0, payload: $1)) }
)
// or
let new: [Key: NewValue] = old.reduce(into: [:]) {
    $0[$1.key] = transform(id: $1.key, payload: $1.value)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;두 방법 모두&amp;nbsp;심각하게 비효율적입니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;첫 번째 방법: 모든 key를 다시 hashing&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;두 번째 방법: 여러 번의 중간 재할당 발생&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;벤치마크를 돌려보면 첫 번째가 중간 재할당이 적어서 그나마 조금 덜 나쁜 정도입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary key를 변환하는 케이스도 있지만, &lt;b&gt;이 제안은 key는 절대 수정하지 않고 컨텍스트로만 사용하는 케이스에 집중하고 있습니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;제안된 솔루션&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;Dictionary에 새로운 메서드를 추가합니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Dictionary {
    @inlinable public func mapValuesWithKeys&amp;lt;T, E&amp;gt;(
        _ transform: (Key, Value) throws(E) -&amp;gt; T
    ) throws(E) -&amp;gt; Dictionary&amp;lt;Key, T&amp;gt;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;사용 예시&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let balances: [Currency: Int64] = [.USD: 13, .EUR: 15]
let displayText: [Currency: String] = balances.mapValuesWithKeys {
    &quot;\($0.alpha3) balance: \($1)&quot;
}&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;간단하죠? &lt;br /&gt;Key 정보를 사용하면서도 rehashing 없이 깔끔하게 값만 변환합니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;상세 설계&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;구현은 기존&amp;nbsp;mapValues와 유사하지만, &lt;b&gt;storage iteration loop 내부에서 key와 value를 함께 transformation closure에 전달합니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Apple 플랫폼 호환성&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Apple 플랫폼에서&amp;nbsp;&lt;b&gt;Dictionary는 Cocoa dictionary로 backing될 수 있습니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 큰 문제는 없다고 말하고 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;__CocoaDictionary에도&amp;nbsp;_NativeDictionary와 본질적으로 동일한 메커니즘을 추가하면 되고, 새로운&amp;nbsp;mapValuesWithKeys가 기존&amp;nbsp;mapValues처럼 두 구현 사이에서 dispatch하면 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; font-size: 1.12em; letter-spacing: 0px;&quot;&gt;고려된 대안들&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기존 mapValues 오버로딩?&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;원래 &lt;b&gt;초안에서는 기존&amp;nbsp;mapValues&amp;nbsp;메서드를 오버로딩해서&amp;nbsp;Key와&amp;nbsp;Value를 모두 받는 closure를 지원하려고 했습니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만&lt;b&gt; 이게 source-breaking인 걸 발견했어요.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;드물지만 value 타입이 2-tuple인 dictionary에서&amp;nbsp;mapValues를 호출하는 경우가 있거든요.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let dict: [String: (Int, String)] = [&quot;a&quot;: (1, &quot;x&quot;)]
dict.mapValues { ... } // 모호해짐&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;그래서 source compatibility를 위해 새로운 이름&amp;nbsp;mapValuesWithKeys를 선택했습니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;compactMapValues도 추가?&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;mapValuesWithKeys를 추가하면&amp;nbsp;compactMapValues와 API 비대칭이 생깁니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;compactMapValues는 key context를 지원하지 않으니까요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 compactMapValues는 본질적으로 reduce(into:)의 shorthand라서 성능 측면의 동기가 훨씬 약하거든요.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;아무것도 하지 않기?&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary는 extensively frozen type이라서, 개발자가 user space에서 stable-but-unspecified implementation detail에 의존해서 key context를 지원하도록 retrofit할 수도 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 이건 좋은 워크플로우가 아니고 권장해서도 안 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;향후 방향&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;mapValues 이름 재할당?&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;미래에는 &lt;b&gt;기존&amp;nbsp;mapValues&amp;nbsp;메서드를&amp;nbsp;mapValuesWithoutKeys&amp;nbsp;같은 이름으로 바꿀 수도 있습니다&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;그러면&amp;nbsp;mapValues&amp;nbsp;이름을 key context를 제공하는 버전에 재할당할 수 있겠죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다음 언어 모드에서 가능할 것 같습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;OrderedDictionary 변경 (swift-collections)&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;이 제안의 자연스러운 확장으로,&amp;nbsp;swift-collections&amp;nbsp;패키지의&amp;nbsp;OrderedDictionary&amp;nbsp;타입도&amp;nbsp;mapValuesWithKeys&amp;nbsp;메서드를 가질 수 있습니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension OrderedDictionary {
    @inlinable public func mapValuesWithKeys&amp;lt;T, E&amp;gt;(
        _ transform: (Key, Value) throws(E) -&amp;gt; T
    ) throws(E) -&amp;gt; OrderedDictionary&amp;lt;Key, T&amp;gt;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;OrderedDictionary의 성능 향상은&amp;nbsp;Dictionary보다&amp;nbsp;더 클 수 있습니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;OrderedDictionary는 keys와 values를 위한 표준&amp;nbsp;Array와 lookup을 위한 sidecar hash table을 유지하거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;현재 workaround(reduce나&amp;nbsp;init)는 전체 hash table을 재구성하고 keys array를 eager copy해야 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;대신 zipped iteration을 사용해서 underlying&amp;nbsp;_keys와&amp;nbsp;_values&amp;nbsp;array를 새로운 values array로 매핑하고,&amp;nbsp;_keys&amp;nbsp;table(hash table&amp;nbsp;__storage&amp;nbsp;포함)을 복사하면 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이건 mutate하지 않으면 O(1) copy-on-write이고, 나중에 mutate하면 O(n)입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Dictionary 값을 변환하면서 key도 사용하는 건 흔한 패턴인데, 지금까지는 불필요한 성능 비용을 감수해야 했는데 이런 메서드가 제공되면 조금 더 편하게 사용될 수 있을것 같네요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;특히 Currency 같은 enum을 key로 쓰면서 display text를 만드는 예시처럼, key가 formatting context를 제공하는 경우가 많잖아요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;간단한 추가지만 현업에서 많이 쓰일 것 같네요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;References&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1771602171556&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;Giving Dictionary.mapValues(_:) access to the associated key&quot; data-og-description=&quot;currently, when it is needed to compute the mapped dictionary value using the dictionary key, it is required to do one of the following: let new: [Key: NewValue] = .init( uniqueKeysWithValues: old.lazy.map { ($0, transform(id: $0, payload: $1)) } ) // or l&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/giving-dictionary-mapvalues-access-to-the-associated-key/83904&quot; data-og-url=&quot;https://forums.swift.org/t/giving-dictionary-mapvalues-access-to-the-associated-key/83904&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/dpCpkA/dJMb8VNr0iE/PdytJKxHf3hOp1Lk8gPODk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/x4Cjh/dJMb8T9V7od/smMMLOZkItGpimBqR1zbck/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/giving-dictionary-mapvalues-access-to-the-associated-key/83904&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/giving-dictionary-mapvalues-access-to-the-associated-key/83904&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/dpCpkA/dJMb8VNr0iE/PdytJKxHf3hOp1Lk8gPODk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/x4Cjh/dJMb8T9V7od/smMMLOZkItGpimBqR1zbck/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;Giving Dictionary.mapValues(_:) access to the associated key&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;currently, when it is needed to compute the mapped dictionary value using the dictionary key, it is required to do one of the following: let new: [Key: NewValue] = .init( uniqueKeysWithValues: old.lazy.map { ($0, transform(id: $0, payload: $1)) } ) // or l&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1771602180842&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;SE-0510: Dictionary mapValuesWithKeys&quot; data-og-description=&quot;The review of SE-0510: Dictionary mapValuesWithKeys begins now and runs through February 17, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your fe&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/se-0510-dictionary-mapvalueswithkeys/84547&quot; data-og-url=&quot;https://forums.swift.org/t/se-0510-dictionary-mapvalueswithkeys/84547&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/M4qBa/dJMb9gxh3gD/Mb5K1W7FyaI2CGNzc3LBlk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bHfYVO/dJMb9b3OJMe/0kWn5erbD6F2ZgjIPZKBn0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/se-0510-dictionary-mapvalueswithkeys/84547&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/se-0510-dictionary-mapvalueswithkeys/84547&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/M4qBa/dJMb9gxh3gD/Mb5K1W7FyaI2CGNzc3LBlk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bHfYVO/dJMb9b3OJMe/0kWn5erbD6F2ZgjIPZKBn0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;SE-0510: Dictionary mapValuesWithKeys&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;The review of SE-0510: Dictionary mapValuesWithKeys begins now and runs through February 17, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your fe&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>Apple</category>
      <category>Dictionary</category>
      <category>ios</category>
      <category>mapValuesWithKeys</category>
      <category>SE-0510</category>
      <category>SWIFT</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/610</guid>
      <comments>https://green1229.tistory.com/610#entry610comment</comments>
      <pubDate>Sat, 21 Feb 2026 00:45:23 +0900</pubDate>
    </item>
    <item>
      <title>[SE-0508] Array expression trailing closures</title>
      <link>https://green1229.tistory.com/609</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;SE-0508 Array expression trailing closures&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/lVn5h/dJMcaaxtxgV/YOvOdlsqXs5DWM4QP2WLO1/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/lVn5h/dJMcaaxtxgV/YOvOdlsqXs5DWM4QP2WLO1/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/lVn5h/dJMcaaxtxgV/YOvOdlsqXs5DWM4QP2WLO1/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlVn5h%2FdJMcaaxtxgV%2FYOvOdlsqXs5DWM4QP2WLO1%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123123.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift에서 trailing closure는 정말 자주 쓰는 문법이죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;그런데 array나 dictionary 타입 뒤에는 trailing closure를 쓸 수 없다는 걸 아셨나요?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;[String]&amp;nbsp;같은 타입 뒤에 중괄호를 쓰면 파서가 제대로 인식하지 못해서 에러가 발생합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 SE-0508은 바로 이 제약을 풀어주는 제안입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이미&amp;nbsp;&lt;b&gt;Accepted&lt;/b&gt;&amp;nbsp;상태이고 구현도 완료되었으니, 곧 실제로 활용할 수 있을거에요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;왜 필요한가?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Array에 trailing closure를 받는&amp;nbsp;init을 정의하는 건 꽤 합리적인 디자인입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;예를 들어&amp;nbsp;@ArrayBuilder&amp;nbsp;result builder가 있다면&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Array {
    init(@ArrayBuilder build: () -&amp;gt; [Element]) {
        self = build()
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;또는 nil을 반환할 때까지 element를 생성하는 init&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Array {
    init(generate: () -&amp;gt; Element?) {
        self = []
        while let element = generate() {
            append(element)
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;하지만 이렇게 쓸 수 없습니다&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;대부분의 경우 closure를 받는&amp;nbsp;init은 trailing closure 문법으로 호출할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;그런데&amp;nbsp;Array나&amp;nbsp;Dictionary&amp;nbsp;타입에서는 파서가 이를 허용하지 않아요.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// error: 'let' declarations cannot be computed properties
let value = [String] {
  &quot;a&quot;
}

// error: variable with getter/setter cannot have an initial value
var value = [String] {
  &quot;a&quot;
}

// error: closure expression is unused
let value = [String]
{
  &quot;a&quot;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;대신 이렇게 써야 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let value = [String].init {
  &quot;a&quot;
}

let value = [String]() {
  &quot;a&quot;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;InlineArray는 된다?&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;흥미롭게도&amp;nbsp;InlineArray에서는 trailing closure가&amp;nbsp;&lt;b&gt;이미 지원됩니다&lt;/b&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let powersOfTwo = [4 of Int] { index in
  1 &amp;lt;&amp;lt; index
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Array와&amp;nbsp;Dictionary에서만 안 되는 건 불필요한 제약이고,&amp;nbsp;InlineArray와도 일관성이 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;제안된 해결책&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Array 타입과 dictionary 타입 뒤에 trailing closure를 쓸 수 있게 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let value = [String] {
  &quot;a&quot;
}

let value = [String: Int] {
  (key: &quot;a&quot;, value: 42)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;이제 이런 코드가 정상적으로 파싱되고 컴파일됩니다!&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;어떻게 동작하나?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;현재 파싱 동작을 이해하려면 두 가지를 알아야 합니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;1.&amp;nbsp;[...]는 항상 literal로 파싱됨&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;표현식을 파싱할 때&amp;nbsp;[...]&amp;nbsp;토큰은 항상 array나 dictionary&amp;nbsp;&lt;b&gt;literal&lt;/b&gt;로 파싱됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;[String]이나&amp;nbsp;[String: Int]&amp;nbsp;같은 경우, 필요하면 타입 체크 단계에서 array/dictionary&amp;nbsp;&lt;b&gt;타입&lt;/b&gt;으로 변환됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;[String]이 실제로는&amp;nbsp;let String = &quot;a&quot;&amp;nbsp;프로퍼티를 사용하는 단일 요소 array literal일 수도 있으니까요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;2. 중괄호는 trailing closure... 단 literal 뒤는 제외&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;표현식 뒤에&amp;nbsp;{&amp;nbsp;토큰이 오면 trailing closure로 해석됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;단, 이전 표현식이 literal인 경우는 제외&lt;/b&gt;입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift 5.2에서&amp;nbsp;callAsFunction이 도입되기 전(SE-0253)까지는 이게 합리적이었습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;literal 뒤에 trailing closure가 올 valid한 케이스가 없었거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;솔루션&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Array와 dictionary literal 뒤에 trailing closure를 허용하도록 변경합니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이렇게 하면 이런 init(_:) trailing closure 예시가 제대로 파싱되고 컴파일됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let value = [String] {
  &quot;a&quot;
}

let value = [String: Int] {
  (key: &quot;a&quot;, value: 42)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;추가 효과: callAsFunction도 지원&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;결과적으로 callAsFunction trailing closure도 지원됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Array {
    func callAsFunction&amp;lt;T&amp;gt;(mapElement: (Element) -&amp;gt; T) -&amp;gt; [T] {
        map(mapElement)
    }
}

let value = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;] {
    $0.uppercased()
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;작은 비용으로 언어의 표현력과 일관성이 크게 향상됩니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;호환성&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Source compatibility&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 파싱 변경은 array literal 뒤에 오는 기존 closure literal의 의미를 바꿉니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 현재 실제로 컴파일되는 케이스는 거의 없어요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;대부분은 closure expression is unused 에러가 납니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;] { // error: closure expression is unused
  &quot;a&quot;
}

[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]
{ &quot;a&quot; } // error: closure expression is unused&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;에러가 안 나는 유일한 케이스&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Closure를 받는 result builder에서만 에러가 안 납니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@resultBuilder
enum FunctionArrayBuilder {
    static func buildBlock(_ components: (() -&amp;gt; Void)...) -&amp;gt; [() -&amp;gt; Void] {
        components
    }
}

@FunctionArrayBuilder
var buildFunctions: [() -&amp;gt; Void] {
    let array = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]
    { print(array) }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 코드는 이제 컴파일되지 않습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 이 result builder 케이스는 이미 매우 취약하고 비실용적입니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;왜 취약한가?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: circle; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;circle&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;연속된 closure literal은 세미콜론 없이 지원 안 됨&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@FunctionArrayBuilder
var buildFunctions: [() -&amp;gt; Void] {
    { print(&quot;a&quot;) }
    { print(&quot;b&quot;) } // error: extra trailing closure passed in call
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: circle; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;circle&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;작은 변경으로도 컴파일이 깨짐&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// Compiles
@FunctionArrayBuilder
var buildFunctions: [() -&amp;gt; Void] {
    let array = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]
    { print(array) };
    { print(array.count) }
}&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;// Doesn't compile
@FunctionArrayBuilder
var buildFunctions: [() -&amp;gt; Void] {
    let array = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]
    let count = array.count
    { print(array) }; // error: cannot convert value of type '()' to closure result type 'Bool'
    { print(count) }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: circle; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;circle&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;callAsFunction이 있으면 의미가 바뀜&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension Int {
  func callAsFunction(_ closure: () -&amp;gt; Void) -&amp;gt; Int {
    closure()
    return self
  }
}

@FunctionArrayBuilder
var buildFunctions: [() -&amp;gt; Void] {
    let array = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]
    let count = array.count
    { print(array) }; // callAsFunction trailing closure, not an accumulated result builder value
    { print(count) }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;이런 케이스는 실제로 사용되는 예시가 없고, 더 복잡한 파싱 규칙으로 수용하는 것보다 이 source break를 받아들이는 게 낫다고 판단했습니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;ABI compatibility&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기존 선언에 대한 새로운 callsite 문법만 추가하는 거라 ABI에 영향이 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;향후 방향&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;모든 literal에 trailing closure 허용?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이 제안은 array와 dictionary literal만 지원합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;더 나아가서&amp;nbsp;&lt;b&gt;모든 literal&lt;/b&gt;에 trailing closure를 허용할 수도 있어요.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;extension String {
  func callAsFunction(_ closure: (String) -&amp;gt; Void) {
    closure(self)
  }
}

&quot;Hello world&quot; { // currently, error: closure expression is unused 
  print($0)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다른 trailing closure 케이스와 더 일관되고, 특별한 단점도 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다만 array/dictionary만큼 강력하게 동기부여되지는 않아요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Array와 dictionary는 타입 표현식이 literal로 파싱되는 잠재적 모호성 때문에 특별하거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;고려된 대안들&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;추가 파싱 휴리스틱&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;같은 줄에서만 허용?&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Source break는 array literal 다음 줄에 result builder closure가 오는 경우입니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@FunctionArrayBuilder
var buildFunctions: [() -&amp;gt; Void] {
    let array = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]
    { print(array) }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;같은 줄에 있으면 이미 컴파일되지 않습니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;@FunctionArrayBuilder
var buildFunctions: [() -&amp;gt; Void] {
    let array1 = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;] { // error: cannot convert return expression of type '()' to return type '[String]'
        print(array)
    }

    let array2 = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;] { // error: variable with getter/setter cannot have an initial value
        [&quot;d&quot;]
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;같은 줄일 때만 trailing closure로 처리하면 source break를 피할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 이건 다른 모든 brace/trailing closure 케이스와 일관성이 없어요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let array = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;].map 
{ 
  $0.uppercased()
}

if array.count &amp;gt;= 3
{
  print(&quot;success: \(array)&quot;)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;이런 임의적인 불일치는 코드 포매팅 도구 같은 생태계 전반에 복잡성을 추가합니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Array 타입만 지원?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Array/dictionary&amp;nbsp;&lt;b&gt;타입&lt;/b&gt;만 지원하고 다른 literal은 제외하는 방법도 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;[String]&amp;nbsp;타입은 valid한 표현식이 아니니까 source compatibility 문제가 없겠죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 파싱 시점에는 [String]이 타입인지 literal인지 알 수 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;let String = &quot;a&quot;
let array = [String] // an array literal, [&quot;a&quot;]
{ print(array) }&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;단일 요소 array/dictionary literal이고 단일 identifier를 포함하는 경우만 허용할 수도 있지만, 이러면&amp;nbsp;callAsFunction&amp;nbsp;케이스가 불필요하게 제거됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;SE-0508은 이미&amp;nbsp;&lt;b&gt;Accepted&lt;/b&gt;되었고 구현도 완료된 상태입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;개인적으로는 정말 합리적인 개선이라고 생각해요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;InlineArray에서는 되는데&amp;nbsp;Array에서는 안 된다는 게 말이 안 됐거든요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;@ArrayBuilder&amp;nbsp;같은 result builder와 함께 쓰면 정말 깔끔한 API를 만들 수 있을 것 같습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;작은 변경이지만 언어의 일관성과 표현력을 크게 높여주는 개선이네요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1771051388731&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;object&quot; data-og-title=&quot;swift-evolution/proposals/0508-array-expression-trailing-closures.md at main &amp;middot; swiftlang/swift-evolution&quot; data-og-description=&quot;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&quot; data-og-host=&quot;github.com&quot; data-og-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0508-array-expression-trailing-closures.md&quot; data-og-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0508-array-expression-trailing-closures.md&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bS0M8s/dJMb81fOPWD/c76NIZp9xG0ojyKY2eBNtk/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/efaHyc/dJMb86OX17s/mxgcN5ifXfbwk4u9N9Y4xK/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0508-array-expression-trailing-closures.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0508-array-expression-trailing-closures.md&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bS0M8s/dJMb81fOPWD/c76NIZp9xG0ojyKY2eBNtk/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/efaHyc/dJMb86OX17s/mxgcN5ifXfbwk4u9N9Y4xK/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift-evolution/proposals/0508-array-expression-trailing-closures.md at main &amp;middot; swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;github.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1771051390535&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;Support trailing closure syntax for single-argument Array and Dictionary initializers&quot; data-og-description=&quot;In the recent discussion about @ArrayBuilder, it came up that trailing closure syntax is not currently supported in the most intuitive way for Array initializers like init(@ArrayBuilder build: () -&amp;gt; [Element]): I investigated this on the parsing side, and &quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/support-trailing-closure-syntax-for-single-argument-array-and-dictionary-initializers/83900&quot; data-og-url=&quot;https://forums.swift.org/t/support-trailing-closure-syntax-for-single-argument-array-and-dictionary-initializers/83900&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/dGvRso/dJMb8RjX80E/0o15WTQ5BcEMSwkM8oqcrk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bUV400/dJMb8WMlMqJ/Nx7x25m9RFBMMED0ubWtO0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/support-trailing-closure-syntax-for-single-argument-array-and-dictionary-initializers/83900&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/support-trailing-closure-syntax-for-single-argument-array-and-dictionary-initializers/83900&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/dGvRso/dJMb8RjX80E/0o15WTQ5BcEMSwkM8oqcrk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bUV400/dJMb8WMlMqJ/Nx7x25m9RFBMMED0ubWtO0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;Support trailing closure syntax for single-argument Array and Dictionary initializers&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;In the recent discussion about @ArrayBuilder, it came up that trailing closure syntax is not currently supported in the most intuitive way for Array initializers like init(@ArrayBuilder build: () -&amp;gt; [Element]): I investigated this on the parsing side, and&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1771051391760&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;SE-0508: Array expression trailing closures&quot; data-og-description=&quot;Hi everyone, The review of SE-0508: Array expression trailing closures begins now and runs through February 12, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would l&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/se-0508-array-expression-trailing-closures/84479&quot; data-og-url=&quot;https://forums.swift.org/t/se-0508-array-expression-trailing-closures/84479&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/mrO38/dJMb9cBEklL/KSq5U4vhCLOSpsia3zRM90/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bh9p0b/dJMb9bvYwCl/uSf6zpRxKdTLUowmZ3JME0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/se-0508-array-expression-trailing-closures/84479&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/se-0508-array-expression-trailing-closures/84479&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/mrO38/dJMb9cBEklL/KSq5U4vhCLOSpsia3zRM90/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/bh9p0b/dJMb9bvYwCl/uSf6zpRxKdTLUowmZ3JME0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;SE-0508: Array expression trailing closures&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hi everyone, The review of SE-0508: Array expression trailing closures begins now and runs through February 12, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would l&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1771051392730&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;[Accepted] SE-0508: Array expression trailing closures&quot; data-og-description=&quot;Hi all, The review of SE-0508: Array expression trailing closures concluded on February 12, 2026. The language steering group has decided to accept the proposal. Feedback was positive on adding language support for trailing closures after sugared array and&quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/accepted-se-0508-array-expression-trailing-closures/84728&quot; data-og-url=&quot;https://forums.swift.org/t/accepted-se-0508-array-expression-trailing-closures/84728&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/c0FFeY/dJMb9kTZaKi/KsEQq7QczXPkymQBv9cl41/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cF03Ps/dJMb9dHkf7G/rhBtpMJDOLaoZQ4yVBmvc1/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/accepted-se-0508-array-expression-trailing-closures/84728&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/accepted-se-0508-array-expression-trailing-closures/84728&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/c0FFeY/dJMb9kTZaKi/KsEQq7QczXPkymQBv9cl41/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cF03Ps/dJMb9dHkf7G/rhBtpMJDOLaoZQ4yVBmvc1/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;[Accepted] SE-0508: Array expression trailing closures&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hi all, The review of SE-0508: Array expression trailing closures concluded on February 12, 2026. The language steering group has decided to accept the proposal. Feedback was positive on adding language support for trailing closures after sugared array and&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>ios</category>
      <category>SE-0508</category>
      <category>SWIFT</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/609</guid>
      <comments>https://green1229.tistory.com/609#entry609comment</comments>
      <pubDate>Sat, 14 Feb 2026 15:44:20 +0900</pubDate>
    </item>
    <item>
      <title>[SE-0507] Borrow and Mutate Accessors</title>
      <link>https://green1229.tistory.com/608</link>
      <description>&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;안녕하세요.&amp;nbsp;&lt;span style=&quot;color: #409d00;&quot;&gt;&lt;b&gt;그린&lt;/b&gt;&lt;/span&gt;입니다  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이번 포스팅에서는&amp;nbsp;&lt;span style=&quot;background-color: #9feec3;&quot;&gt;&lt;b&gt;SE-0507 Borrow and Mutate Accessors&lt;/b&gt;&lt;/span&gt;에 대해 정리해보겠습니다  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;123123213.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bMNm6h/dJMcacosInm/r4LBgOCIpNeSUcG0RWFlt1/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bMNm6h/dJMcacosInm/r4LBgOCIpNeSUcG0RWFlt1/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bMNm6h/dJMcacosInm/r4LBgOCIpNeSUcG0RWFlt1/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbMNm6h%2FdJMcacosInm%2Fr4LBgOCIpNeSUcG0RWFlt1%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;400&quot; height=&quot;400&quot; data-filename=&quot;123123213.001.jpeg&quot; data-origin-width=&quot;400&quot; data-origin-height=&quot;400&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Intro&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift의 property accessor는 계속 발전중입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기존에는&amp;nbsp;get,&amp;nbsp;set, 그리고 최근 추가된&amp;nbsp;yielding borrow,&amp;nbsp;yielding mutate가 있었는데요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;이번 SE-0507은 새로운&amp;nbsp;borrow와&amp;nbsp;mutate&amp;nbsp;accessor를 제안합니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;얘네들은&amp;nbsp;&lt;b&gt;borrowing semantics&lt;/b&gt;를 사용해서 복사 오버헤드 없이 값에 접근할 수 있고, yielding accessor보다 성능이 좋습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;특히 non-copyable 타입을 다루는 collection이나 성능이 중요한 저수준 데이터 구조에 유용할 거예요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;현재 2026년 2월 9일까지 리뷰가 진행 중이긴한데 현 시점에서 Draft 상태라 계획대로 내일까지 반영될진 지켜봐야 알것 같아요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;왜 필요한가?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;기존 accessor들은 각각 한계가 있습니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;문제 1:&amp;nbsp;get은 복사해야 한다&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;get&amp;nbsp;accessor는 값을 복사하거나 새로 생성해서 반환해야 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;복사의 코스트가 많이 들거나 불가능한 경우엔 쓸 수 없죠.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot;&gt;&lt;code&gt;struct NC: ~Copyable { ... }
struct ContainerOfNoncopyable {
    private var _element: NC
    var element: Element {
        return _element //   ERROR: Cannot copy `_element`
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Non-copyable 값을 저장하는 collection은 subscript에&amp;nbsp;get을 쓸 수 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;문제 2: yielding accessor는 오버헤드가 크다&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;yielding mutate와&amp;nbsp;yielding borrow는 coroutine을 사용합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;접근 전후로 코드를 실행할 수 있어서 유연하지만, 그만큼 오버헤드가 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Coroutine을 위한 메모리 할당&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;여러 번의 함수 호출&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;접근 scope가 제한됨 (함수가 끝나기 전에 완료되어야 함)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot;&gt;&lt;code&gt;struct Element: ~Copyable {
  var span: Span&amp;lt;...&amp;gt; { ... }
}

struct Wrapper: ~Copyable {
    private var _element: Element
    var element: Element {
        yielding borrow { // ❗️Note: Using `yielding borrow` accessor
            yield _element
        }
    }
}

func getSpan(wrapper: borrowing Wrapper) -&amp;gt; Span&amp;lt;...&amp;gt; {
    // Because we're reading `element` from a yielding accessor,
    // its access must finish before `getSpan` returns.
    // But `span` cannot outlive `element`, so ...

    //   ERROR: lifetime-dependent value escapes its scope
    return wrapper.element.span
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrowing accessor는 이 두 문제를 모두 해결합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;제안된 솔루션&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;새로운&amp;nbsp;borrow와&amp;nbsp;mutate&amp;nbsp;키워드로 accessor를 정의합니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct RigidWrapper&amp;lt;Element: ~Copyable&amp;gt;: ~Copyable {
    var _element: Element
    var element: Element {
        borrow {
            return _element
        }
        mutate {
            return &amp;amp;_element
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;borrow: 읽기 전용 접근, 복사하지 않음&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;mutate: 읽기/쓰기 접근,&amp;nbsp;&amp;amp;로 mutable reference 반환&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;yield&amp;nbsp;대신&amp;nbsp;return을 쓰는 게 차이점입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;물론 single expression이면&amp;nbsp;return&amp;nbsp;키워드는 생략 가능합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;상세 설계&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;반환 값의 제약&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrowing accessor는&amp;nbsp;&lt;b&gt;저장된 값&lt;/b&gt;만 반환할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;local이나 temporary 값은 반환할 수 없어요.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct InvalidExamples {
    var _array : [Int]
    
    var local: [Int] {
        borrow {
            let foo = [1, 2, 3]
            //   ERROR: Cannot return local value from borrow accessor
            return foo
        }
    }
    
    var temporary: [Int]? {
        borrow {
            // This would require creating a temporary local
            // optional array from `_array`.
            //   ERROR: Cannot return temporary value from borrow accessor
            return _array
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;반환하는 값은 accessor 실행이 끝난 후에도 유효해야 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;사용 방법&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;borrow로 읽기&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;클라이언트 코드는 기존&amp;nbsp;get과 동일하게 보이지만, 내부적으로는 복사가 일어나지 않습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;var owner = Wrapper(value)

// &quot;borrow&quot; the value to give to a function
// without copying...
doSomething(with: owner.element)

func doSomething(with value: borrowing Element) {
    // `value` is borrowed, so this invokes
    // the method &quot;in-place&quot;
    value.someMethod() 

    // Exclusivity prevents the owner from being
    // mutated while `value` is alive:
    owner.mutatingMethod() //   ERROR
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;메모리 일관성을 위해 Swift의 exclusivity rule이 적용됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;borrow가 활성화된 동안엔 owner를 변경할 수 없어요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;mutate로 수정하기&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;mutate&amp;nbsp;accessor는 읽기/쓰기 접근을 제공합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;var owner = Wrapper(value)

// Mutating/inout access will invoke the `mutate` accessor
doSomething(with: &amp;amp;owner.element)

func doSomeMutation(with value: inout Element) {
    // So this invokes a method on the value &quot;in-place&quot;
    // Because you borrowed for mutation, this can be
    // a mutating method.
    value.someMutatingMethod()

    // Accessing the owner is an exclusivity violation
    owner.anyMethod() //   ERROR
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;다른 accessor와의 호환성&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;mutate를 제공하면&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;borrow도 반드시 제공해야 함&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;yielding mutate나&amp;nbsp;yielding borrow는 사용 불가&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift는 일반적으로 write-only property를 허용하지 않습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;또한 읽기와 쓰기 작업의 접근 scope를 일관되게 유지해야 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;borrow를 제공하면&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;get이나&amp;nbsp;yielding borrow는 사용 불가&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;여러 read accessor나 여러 write accessor를 동시에 정의하면 호출자 입장에서 혼란스럽기 때문입니다.&lt;/span&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Ownership 변형&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기본적으로 아래와 같아요.&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;borrow: 포함하는 값을 변경하지 않음&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;mutate: 포함하는 값을 변경함&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이걸&amp;nbsp;mutating이나&amp;nbsp;nonmutating&amp;nbsp;키워드로 오버라이드할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;mutating borrow&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;읽기 전용이지만 side-effect로 인해 포함하는 값이 변경될 수 있는 경우입니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct S1 {
  private var cachedValue: Foo
  var foo : Foo {
    mutating borrow {
      if !cachedValue.available {
        // Update `cachedValue`
        // Compiler allows such update
        // because this is `mutating`
      }
      return cachedValue
    }
  }
}

let s1: S1 // Note: Immutable value
s1.foo //   Cannot use mutating accessor on immutable value&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;캐시를 업데이트하는 경우 같은 거죠.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;nonmutating mutate&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;값을 변경할 수 있지만 부모 값의 변경으로 간주되지 않는 경우입니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct Outer {
  var inner: InnerType {
    borrow {
      return some_value_stored_elsewhere
    }
    nonmutating mutate {
      return &amp;amp;some_value_stored_elsewhere
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;외부에 저장된 값에 접근하는 경우 같은 거예요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Protocol requirement로 사용&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Protocol에서도 borrowing accessor를 요구할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot;&gt;&lt;code&gt;protocol BorrowingAccess {
  associatedtype Element
  var element: Element { borrow mutate }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이는 두 가지 기능이 있어요.&lt;/span&gt;&lt;/p&gt;
&lt;ol style=&quot;list-style-type: decimal; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Protocol을 통한 접근 방식을 제어 (existential이나 generic argument에서)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;conforming 타입에 해당 accessor가 있어야 함 (명시적 구현 또는 컴파일러 합성)&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;컴파일러 합성&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Stored property &amp;rarr;&amp;nbsp;borrow,&amp;nbsp;mutate&amp;nbsp;합성 가능&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;borrow&amp;nbsp;구현 &amp;rarr;&amp;nbsp;yielding borrow나&amp;nbsp;get&amp;nbsp;합성 가능 (copyable만)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;mutate&amp;nbsp;구현 &amp;rarr;&amp;nbsp;set이나&amp;nbsp;yielding mutate&amp;nbsp;합성 가능&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;제약사항&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc; color: #000000; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Protocol이&amp;nbsp;borrow&amp;nbsp;요구 &amp;rarr; conforming 타입도&amp;nbsp;borrow&amp;nbsp;필요&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Protocol이&amp;nbsp;mutate&amp;nbsp;요구 &amp;rarr; conforming 타입은&amp;nbsp;borrow와&amp;nbsp;mutate&amp;nbsp;모두 필요&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Class와 Actor에서는 불가&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Class는 property 접근 전후로 runtime exclusivity check를 실행해야 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrowing accessor는 접근 후에 코드를 실행할 방법이 없어서 class property에는 사용할 수 없습니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;yielding borrow와&amp;nbsp;yielding mutate는 class property에 사용 가능합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Subscript에도 사용 가능&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct ArrayLikeType {
  subscript(index: Int) -&amp;gt; Element {
    borrow { .... }
    mutate { .... }
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;다만 subscript는 전체 struct를 암묵적으로 접근하므로, 아래 코드는 불가능해요.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;var x: ArrayLikeType
swap(&amp;amp;x[0], &amp;amp;x[1]) //   두 개의 mutating access&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;호환성&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Source compatibility&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;기존에&amp;nbsp;borrow나&amp;nbsp;mutate라는 이름의 함수를 trailing closure로 호출하는 경우와 충돌 가능성이 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot;&gt;&lt;code&gt;struct S {
  func borrow(closure: () -&amp;gt; ()) { ... }
  // Is this a new borrow accessor?
  // Or a call to the borrow method just above?
  var property: Int { borrow { ... } }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 실제로는 거의 발생하지 않을 것으로 봅니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;ABI compatibility&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;새로운 기능이라 기존 ABI에는 영향이 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Adoption 영향&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Non-borrowing accessor를 borrowing accessor로 바꾸는 건 일반적으로&amp;nbsp;&lt;b&gt;ABI-breaking&lt;/b&gt;입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;하지만 existential type의 ABI는 보존됩니다. (컴파일러가 계속 accessor를 합성할 수 있다면)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Source-breaking일 수도 있습니다. 특히&amp;nbsp;get을&amp;nbsp;borrow로 바꾸면 lifetime 제약이 생겨서 기존 코드가 컴파일되지 않을 수 있어요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;향후 방향성&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Borrowing returns&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;함수에서도 borrowed 값을 반환할 수 있으면 유용합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;struct S&amp;lt;Value&amp;gt; {
  subscript(_ index: Int) -&amp;gt; Value {
     borrow { ... }
  }
  func indirect(_ parameter: Foo) -&amp;gt; borrowing Value {
     let index = ... compute index from parameter ...
     return self[index]
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Unsafe pointer를 통한 borrowing&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;저수준 데이터 구조는 종종 unsafe pointer를 사용합니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;var _storage: UnsafePointer&amp;lt;Element&amp;gt;

var first: Element {
  borrow {
    // ERROR: borrow accessors can only return stored properties
    // or computed properties that have borrow accessors
    return _storage.pointee
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;이런 케이스를 지원하려면 뭔가 annotation이 필요할 것 같습니다.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;swift&quot; style=&quot;color: #000000; text-align: start;&quot; data-ke-language=&quot;swift&quot;&gt;&lt;code&gt;var first: Element {
  borrow {
    return unsafeResultDependsOnSelf(_storage.pointee)
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;나왔던 대안&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;아무것도 하지 않기?&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Yielding coroutine-based accessor도 비슷한 기능을 제공하지만, 성능 특성이 다릅니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Coroutine accessor는 접근 후에 코드를 실행할 수 있어서 의미론적으로는 더 강력하지만, 완전히 inline되지 않으면 여러 함수 호출 오버헤드가 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Borrowing accessor는 여러 함수 호출 오버헤드 없이 in-place mutation 기능을 제공합니다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;특히나 유용한 제안이라고 생각되는 포인트는 non-copyable 타입을 다루는 collection이나 성능이 중요한 저수준 코드에서 큰 도움이 될 것 같아요.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;get의 복사 오버헤드와 yielding accessor의 coroutine 오버헤드 사이의 sweet spot을 찾은 느낌입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;Swift Standard Library 팀에서도 이 기능을 원했다고 하니, 실무에서 정말 필요한 기능인 것 같네요  &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size18&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: 'Nanum Gothic'; color: #000000;&quot;&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;figure id=&quot;og_1770505989159&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;object&quot; data-og-title=&quot;swift-evolution/proposals/0507-borrow-accessors.md at main &amp;middot; swiftlang/swift-evolution&quot; data-og-description=&quot;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&quot; data-og-host=&quot;github.com&quot; data-og-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0507-borrow-accessors.md&quot; data-og-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0507-borrow-accessors.md&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/ctPukB/dJMb9dHjFxz/rPnfoqlUZ4qumwRqATtnpk/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/bdORDD/dJMb9fZqV5N/AkOXRj8eXvJSDwE9R37zz0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600&quot;&gt;&lt;a href=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0507-borrow-accessors.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://github.com/swiftlang/swift-evolution/blob/main/proposals/0507-borrow-accessors.md&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/ctPukB/dJMb9dHjFxz/rPnfoqlUZ4qumwRqATtnpk/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600,https://scrap.kakaocdn.net/dn/bdORDD/dJMb9fZqV5N/AkOXRj8eXvJSDwE9R37zz0/img.png?width=1200&amp;amp;height=600&amp;amp;face=0_0_1200_600');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;swift-evolution/proposals/0507-borrow-accessors.md at main &amp;middot; swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;github.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1770505992248&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;[Pitch] Borrowing Accessors&quot; data-og-description=&quot;I just put up the draft proposal for Borrowing Accessors, which together with Yielding Accessors completes the full suite of accessor support described in the Prospective Vision for Accessors. More complete details are in the draft proposal. The following &quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/pitch-borrowing-accessors/83933&quot; data-og-url=&quot;https://forums.swift.org/t/pitch-borrowing-accessors/83933&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bmTS6N/dJMb86nTaz5/thh0HrQh32roiksV5DQfb1/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/INQ8e/dJMb8TB5b1Y/vKaE9NKcC5Hx35h96ojMJk/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/pitch-borrowing-accessors/83933&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/pitch-borrowing-accessors/83933&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bmTS6N/dJMb86nTaz5/thh0HrQh32roiksV5DQfb1/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/INQ8e/dJMb8TB5b1Y/vKaE9NKcC5Hx35h96ojMJk/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;[Pitch] Borrowing Accessors&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;I just put up the draft proposal for Borrowing Accessors, which together with Yielding Accessors completes the full suite of accessor support described in the Prospective Vision for Accessors. More complete details are in the draft proposal. The following&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1770505992871&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;SE-0507: Borrow and Mutate Accessors&quot; data-og-description=&quot;Hi everyone, The review of SE-0507 &amp;quot;Borrow and Mutate Accessors&amp;quot; begins now and runs through February 9, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to &quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot; data-og-url=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/ArLsY/dJMb9jgsO0V/MaREBk3jT8n59WyTYrLSaK/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/Vkdgg/dJMb9iICK3v/lMt6Y2eKRhuCzg7lQKTBMK/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/se-0507-borrow-and-mutate-accessors/84376&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/ArLsY/dJMb9jgsO0V/MaREBk3jT8n59WyTYrLSaK/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/Vkdgg/dJMb9iICK3v/lMt6Y2eKRhuCzg7lQKTBMK/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;SE-0507: Borrow and Mutate Accessors&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hi everyone, The review of SE-0507 &quot;Borrow and Mutate Accessors&quot; begins now and runs through February 9, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;figure id=&quot;og_1770505993582&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;[Prospective Vision] Accessors&quot; data-og-description=&quot;Hello, Swift Community. The Language Steering Group would like to gather feedback on a prospective vision for accessors in Swift. Vision documents help describe an overall direction for Swift. The actual Swift changes for executing on the vision will come &quot; data-og-host=&quot;forums.swift.org&quot; data-og-source-url=&quot;https://forums.swift.org/t/prospective-vision-accessors/76707&quot; data-og-url=&quot;https://forums.swift.org/t/prospective-vision-accessors/76707&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/Uj5X6/dJMb9iICK3w/nC3pXJNA1Q0nU5Y6KbMHwk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cTf3MU/dJMb9jgsO0W/66gUNcaH9jsd7hOeewxwp0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150&quot;&gt;&lt;a href=&quot;https://forums.swift.org/t/prospective-vision-accessors/76707&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://forums.swift.org/t/prospective-vision-accessors/76707&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/Uj5X6/dJMb9iICK3w/nC3pXJNA1Q0nU5Y6KbMHwk/img.png?width=590&amp;amp;height=585&amp;amp;face=0_0_590_585,https://scrap.kakaocdn.net/dn/cTf3MU/dJMb9jgsO0W/66gUNcaH9jsd7hOeewxwp0/img.png?width=151&amp;amp;height=150&amp;amp;face=0_0_151_150');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;[Prospective Vision] Accessors&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Hello, Swift Community. The Language Steering Group would like to gather feedback on a prospective vision for accessors in Swift. Vision documents help describe an overall direction for Swift. The actual Swift changes for executing on the vision will come&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;forums.swift.org&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;</description>
      <category>Swift</category>
      <category>Borrow</category>
      <category>mutate</category>
      <category>Property</category>
      <category>SE-0507</category>
      <category>SWIFT</category>
      <author>GREEN.1229</author>
      <guid isPermaLink="true">https://green1229.tistory.com/608</guid>
      <comments>https://green1229.tistory.com/608#entry608comment</comments>
      <pubDate>Sun, 8 Feb 2026 08:14:50 +0900</pubDate>
    </item>
  </channel>
</rss>