Skip to content

Fix MSVC errors compiling GenericSignature.h #6306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions include/swift/AST/GenericSignature.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ class alignas(1 << TypeAlignInBits) GenericSignature final
void getSubstitutionMap(ArrayRef<Substitution> args,
SubstitutionMap &subMap) const;

using LookupConformanceFn =
llvm::function_ref<auto(CanType dependentType,
Type conformingReplacementType,
ProtocolType *conformedProtocol)
-> Optional<ProtocolConformanceRef>>;
using GenericFunction = auto(CanType canType, Type conformingReplacementType,
ProtocolType *conformedProtocol)
->Optional<ProtocolConformanceRef>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not your change, but Im not sure I understand the point of the trailing return with the auto. Also, can you clang-format that line? Pretty sure that it will add a space between -> and the return type.

Copy link
Contributor Author

@hughbe hughbe Dec 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was what clang-format produced for me

using LookupConformanceFn = llvm::function_ref<GenericFunction>;

/// Build an array of substitutions from an interface type substitution map,
/// using the given function to look up conformances.
Expand Down
10 changes: 5 additions & 5 deletions include/swift/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ struct QueryTypeSubstitutionMap {
};

/// Function used to resolve conformances.
using LookupConformanceFn
= llvm::function_ref<auto(CanType dependentType,
Type conformingReplacementType,
ProtocolType *conformedProtocol)
-> Optional<ProtocolConformanceRef>>;
using GenericFunction = auto(CanType dependentType,
Type conformingReplacementType,
ProtocolType *conformedProtocol)
->Optional<ProtocolConformanceRef>;
using LookupConformanceFn = llvm::function_ref<GenericFunction>;

/// Functor class suitable for use as a \c LookupConformanceFn to look up a
/// conformance through a module.
Expand Down