Skip to content

Commit fc9575c

Browse files
committed
[NCGenerics] enable new associated type inference
The experimental-associated-type-inference flag is needed to correctly build programs when NoncopyableGenerics is enabled.
1 parent 9606f52 commit fc9575c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,10 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
895895

896896
Opts.enableFeature(Feature::LayoutPrespecialization);
897897

898-
if (SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS)
898+
if (SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS) {
899899
Opts.enableFeature(Feature::NoncopyableGenerics);
900+
Opts.EnableExperimentalAssociatedTypeInference = true;
901+
}
900902

901903
Opts.EnableAppExtensionLibraryRestrictions |= Args.hasArg(OPT_enable_app_extension_library);
902904
Opts.EnableAppExtensionRestrictions |= Args.hasArg(OPT_enable_app_extension);

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ function(_compile_swift_files
609609

610610
if(SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS)
611611
list(APPEND swift_flags "-enable-experimental-feature" "NoncopyableGenerics")
612+
list(APPEND swift_flags "-Xfrontend" "-enable-experimental-associated-type-inference")
612613
list(APPEND swift_flags "-Xfrontend" "-disable-round-trip-debug-types") # NOTE: temporary until we fix mangling!
613614
endif()
614615

0 commit comments

Comments
 (0)