swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.6k stars 10.37k forks source link

Region base isolation checker confused by default arguments #77620

Open GeorgeLyon opened 2 days ago

GeorgeLyon commented 2 days ago

Description

I received the following diagnostic:

Screenshot 2024-11-14 at 11 33 46 AM

I was able to make it go away by making imagePreprocessingMode optional:

Screenshot 2024-11-14 at 11 34 24 AM

The problematic formulation was imagePreprocessingMode: Claude.Image.PreprocessingMode = .recommended (i.e. non-optional with a non-optional default value).

Reproduction

I was unable to reduce the example, but the problematic diagnostic returns when

imagePreprocessingMode: Claude.Image.PreprocessingMode = .recommended

is used as an argument.

Expected behavior

Isolation checking succeeds

Environment

swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.4 clang-1600.0.30) Target: arm64-apple-macosx15.0

Additional information

No response