mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift -frontend "" shouldn't enter the REPL by default.
This patch fixes a problem where a CompilerInvocation with no arguments would set the LangaugeOpts etc. up for the deprecated-integrated-repl, including setting the module name etc. Now this only happens if you explicitly invoke swift -frontend -repl. Updated testcases that care, and added a new testcase to ensure that an error is properly generated. <rdar://problem/17918172> Swift SVN r21537
This commit is contained in:
@@ -198,10 +198,7 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
|
||||
}
|
||||
} else {
|
||||
// We don't have a mode, so determine a default.
|
||||
if (Opts.InputFilenames.empty()) {
|
||||
// We don't have any input files, so default to the REPL.
|
||||
Action = FrontendOptions::REPL;
|
||||
} else if (Args.hasArg(OPT_emit_module, OPT_emit_module_path)) {
|
||||
if (Args.hasArg(OPT_emit_module, OPT_emit_module_path)) {
|
||||
// We've been told to emit a module, but have no other mode indicators.
|
||||
// As a result, put the frontend into EmitModuleOnly mode.
|
||||
// (Setting up module output will be handled below.)
|
||||
|
||||
Reference in New Issue
Block a user