Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1d82468d70df7761fe33dbe04670a5c89b48a612
      
https://github.com/WebKit/WebKit/commit/1d82468d70df7761fe33dbe04670a5c89b48a612
  Author: Adrian Taylor <[email protected]>
  Date:   2025-12-10 (Wed, 10 Dec 2025)

  Changed paths:
    M Source/WebKit/Configurations/WebKit.xcconfig
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Scripts/webkit/tests/TestWithSwiftMessageReceiver.swift

  Log Message:
  -----------
  Cease to exclude Swift message receiver source files
https://bugs.webkit.org/show_bug.cgi?id=303815
rdar://166125501

Reviewed by Elliott Williams.

(Note that half this PR is generated test code, generated by the Python changes
in the other half of the PR).

Swift should not normally parse code within a
  #if compiler(>=nnn)
block, if the compiler is more recent than that. We use this to exclude the 
'unsafe'
keyword from consideration by pre-Swift-6 compilers, where that's invalid 
syntax.

Unfortunately there was a bug in older Swift compilers -
https://github.com/swiftlang/swift/pull/74415 - which meant that sometimes
it did attempt to parse this code.

This meant we had to do some gymnastics to entirely exclude some Swift files
from consideration by older compilers, which lead to xcconfig complexity that
would get worse as we brought new Swift message receivers into being.

Fortunately, there's a simple fix to work around that compiler bug -
we just need to reverse the nesting of the
  #if compiler
  #if FEATURE_FLAG
blocks. Then older Swift compiler will correctly ignore the code it's
not supposed to see, and won't get upset by the 'unsafe' keyword.
This PR reverses this nesting, which results in a higher volume of generated
code, and thus a higher volume of test code expectations in this PR, but
there should be no functional difference.

Thanks to @emw-apple for spotting the root cause here.

Canonical link: https://commits.webkit.org/304247@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to