profile
viewpoint
Harlan Haskins harlanhaskins Cupertino, CA https://www.harlanhaskins.com @harlanhaskins on Twitter

apple/swift 53897

The Swift Programming Language

apple/swift-evolution 11546

This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.

apple/swift-package-manager 8006

The Package Manager for the Swift Programming Language

apple/swift-corelibs-foundation 4029

The Foundation Project, providing core utilities, internationalization, and OS independence

apple/swift-corelibs-libdispatch 1894

The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware

apple/swift-corelibs-xctest 862

The XCTest Project, A Swift core library for providing unit test support

apple/swift-llbuild 797

A low-level build system, used by Xcode and the Swift Package Manager

apple/swift-lldb 645

This is the version of LLDB that supports the Swift programming language & REPL.

Pull request review commentapple/swift

[Docs] Clarifies `ObjectIdentifier` guarantees

 /// In Swift, only class instances and metatypes have unique identities. There /// is no notion of identity for structs, enums, functions, or tuples. @frozen // trivial-implementation+/// +/// `ObjectIdentifier` is only guaranteed to remain unique for the+/// lifetime of an object. When the instance gets deallocated, its object +/// identifier may be reused for a different object. (Internally, objects are+/// identified by their memory location.)+/// If you need an object identifier over the lifetime of an objec, it may
/// If you need an object identifier over the lifetime of an object, it may
sunbohong

comment created time in a day

PullRequestReviewEvent

create barnchharlanhaskins/swift

branch : main

created branch time in 6 days

pull request commentapple/swift

Frontend: add a frontend flag to disable building module from textual interface

Could you also do this by setting the existing SWIFT_FORCE_MODULE_LOADING environment variable to only-serialized

nkcsgexi

comment created time in 15 days

PullRequestReviewEvent

pull request commentapple/swift

Improve the error message that is emitted when trying to use a bridging header in a framework target

A lot of times when folks want to use a bridging header, it's because they're trying to use an API from a framework that's not modularized. Putting this import in the framework's umbrella header means declaring that those unmodularized declarations are part of your framework's module, which is a recipe for ODR violations (if there are ever 2 Swift frameworks that include the same unmodularized header in their umbrella header, and they're both included in one process, then you'll get a bunch of "Class XXX is defined in both library AAA and BBB, this is undefined behavior" warnings at runtime.

robinkunde

comment created time in 25 days

Pull request review commentapple/swift

Store Clang module imports in addition to Swift overlay.

 class IRGenDebugInfoImpl : public IRGenDebugInfo {            isa<ConstructorDecl>(DeclCtx);   } +  void createImportedModule(llvm::DIScope *Context,+                            ModuleDecl::ImportedModule M, llvm::DIFile *File,+                            unsigned Line) {+    // For cross-import overlay modules also emit an import of the underlying

Right, but does this only apply to cross-import overlays of clang modules? This seems to apply mostly to regular overlays, I can't see anything that makes this specific to cross-import overlays.

adrian-prantl

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift

Store Clang module imports in addition to Swift overlay.

 class IRGenDebugInfoImpl : public IRGenDebugInfo {            isa<ConstructorDecl>(DeclCtx);   } +  void createImportedModule(llvm::DIScope *Context,+                            ModuleDecl::ImportedModule M, llvm::DIFile *File,+                            unsigned Line) {+    // For cross-import overlay modules also emit an import of the underlying

Oh the only concern is that the comment is misleading 😅

adrian-prantl

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift

Store Clang module imports in addition to Swift overlay.

 class IRGenDebugInfoImpl : public IRGenDebugInfo {            isa<ConstructorDecl>(DeclCtx);   } +  void createImportedModule(llvm::DIScope *Context,+                            ModuleDecl::ImportedModule M, llvm::DIFile *File,+                            unsigned Line) {+    // For cross-import overlay modules also emit an import of the underlying

Nope, that's just a regular overlay. A cross-import overlay is e.g. the _MapKit_SwiftUI module in the SDK, it doesn't necessarily need to involve clang modules at all.

adrian-prantl

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift

Store Clang module imports in addition to Swift overlay.

 class IRGenDebugInfoImpl : public IRGenDebugInfo {            isa<ConstructorDecl>(DeclCtx);   } +  void createImportedModule(llvm::DIScope *Context,+                            ModuleDecl::ImportedModule M, llvm::DIFile *File,+                            unsigned Line) {+    // For cross-import overlay modules also emit an import of the underlying

micro-nit: This seems to apply to regular overlays, not cross-import overlays, right?

adrian-prantl

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift-syntax

Add Double and Int Convenience Properties

 public enum SyntaxFactory {   } %   end -%   if not node.is_base():+%   if not node.is_base() and not node.must_uphold_invariant:

Oh sorry! I think makeBlank was meant to be used for e.g. error recovery where we'd just fill in missing tokens with blank values in order to send a well-formed-but-invalid AST to semantic analysis.

vermont42

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift

[docs] Clarify wording around adding new associatedtypes to protocols.

 There are very few safe changes to make to protocols and their members: - The ``@discardableResult`` and ``@warn_unqualified_access`` attributes may   be added to or removed from a function requirement. - A new ``associatedtype`` requirement may be added (with the appropriate-  availability), as long as it has a default implementation.+  availability), as long as it has a default implementation. If the protocol+  did not have one or more ``associatedtype`` requirements before the change,+  then this is a `binary-compatible source-breaking change`.

Should these be double-backticks?

varungandhi-apple

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentapple/swift

Add a SWIFT_STDLIB_STABLE_ABI flag to be able to build the stdlib without -enable-library-evolution

 function(_compile_swift_files     list(APPEND swift_flags "-Xfrontend" "-sil-verify-all")   endif() -  # The standard library and overlays are always built resiliently.-  if(SWIFTFILE_IS_STDLIB)+  # The standard library and overlays are built resiliently when SWIFT_STDLIB_STABLE_ABI=On.+  if(SWIFTFILE_IS_STDLIB AND SWIFT_STDLIB_STABLE_ABI)

Can you also make sure we don’t emit a module interface if library evolution is turned off?

kubamracek

comment created time in 2 months

push eventapple/swift

Harlan Haskins

commit sha d67d7ebc0a9e68b65fc5a719d7a48f4c2160548c

[Serialization] Look for cross-ref errors inside type errors (#33271) In #30614, we started consuming XRefNonLoadedModuleErrors while loading conformances, since a conformance to a type we cannot load usually indicates we're trying to load a protocol that was declared in an @_implementationOnly imported module. We should also consume TypeErrors that we see where the underlying reason is an XRefNonLoadedModuleError, since they're likely indicators of the same thing.

view details

push time in 3 months

PR merged apple/swift

[Serialization] Look for cross-ref errors inside type errors

In #30614, we started consuming XRefNonLoadedModuleErrors while loading conformances, since a conformance to a type we cannot load usually indicates we're trying to load a protocol that was declared in an @_implementationOnly imported module.

We should also consume TypeErrors that we see where the underlying reason is an XRefNonLoadedModuleError, since they're likely indicators of the same thing.

+52 -9

4 comments

3 changed files

harlanhaskins

pr closed time in 3 months

pull request commentapple/swift

[Serialization] Look for cross-ref errors inside type errors

@swift-ci please test Linux

harlanhaskins

comment created time in 3 months

pull request commentapple/swift

[Serialization] Look for cross-ref errors inside type errors

LLDB test timed out...

@swift-ci please test Linux

harlanhaskins

comment created time in 3 months

pull request commentapple/swift

[Serialization] Look for cross-ref errors inside type errors

@swift-ci please test

harlanhaskins

comment created time in 3 months

create barnchharlanhaskins/swift

branch : oh-the-modules-youll-load

created branch time in 3 months

PR opened apple/swift

Reviewers
[Serialization] Look for cross-ref errors inside type errors

In #30614, we started consuming XRefNonLoadedModuleErrors while loading conformances, since a conformance to a type we cannot load usually indicates we're trying to load a protocol that was declared in an @_implementationOnly imported module.

We should also consume TypeErrors that we see where the underlying reason is an XRefNonLoadedModuleError, since they're likely indicators of the same thing.

+52 -9

0 comment

3 changed files

pr created time in 3 months

Pull request review commentapple/swift

[Parser] Diagnose access to the underlying storage of a lazy variable

 DeclNameRef Parser::parseDeclNameRef(DeclNameLoc &loc,     baseNameLoc = consumeIdentifier(         &baseNameId, /*allowDollarIdentifier=*/true);     baseName = baseNameId;+    // Special case: Diagnose access to the underlying storage of a lazy+    // variable.+    if (baseName.getIdentifier().str().startswith("$__lazy_storage_$_") &&

Might be worth hoisting this to a string constant, since it's now duplicated.

theblixguy

comment created time in 3 months

pull request commentapple/swift

[Parser] Diagnose access to the underlying storage of a lazy variable

Good catch, thank you!

theblixguy

comment created time in 3 months

more