title: Segmentation fault on a simple swift script
body: <p>I have a very simple script written in swift and running this with <code>swift file.swift</code></p>
  
  <pre class="lang-swift prettyprint-override"><code>import Foundation
  
  let url = URL(string: "www.google.com")
  </code></pre>
  
  <p>and this gives me a segfault error with this message</p>
  
  <pre><code>Stack dump:
  0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret file.swift -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -color-diagnostics -module-name file 
  1.  Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
  2.  While running user code "file.swift"
  0  swift                    0x00000001101354ea PrintStackTraceSignalHandler(void*) + 42
  1  swift                    0x0000000110134cc0 SignalHandler(int) + 352
  2  libsystem_platform.dylib 0x00007fff6c0aa5fd _sigtramp + 29
  3  libsystem_platform.dylib 0x00007ffee3e196a8 _sigtramp + 2010575048
  4  swift                    0x000000010beb89ba llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef&lt;llvm::GenericValue&gt;) + 458
  5  swift                    0x000000010bebfa2b llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, char const* const*) + 2011
  6  swift                    0x000000010be94aea performCompileStepsPostSILGen(swift::CompilerInstance&amp;, swift::CompilerInvocation&amp;, std::__1::unique_ptr&lt;swift::SILModule, std::__1::default_delete&lt;swift::SILModule&gt; &gt;, bool, llvm::PointerUnion&lt;swift::ModuleDecl*, swift::SourceFile*&gt;, swift::PrimarySpecificPaths const&amp;, bool, int&amp;, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 14362
  7  swift                    0x000000010be894a5 swift::performFrontend(llvm::ArrayRef&lt;char const*&gt;, char const*, void*, swift::FrontendObserver*) + 55813
  8  swift                    0x000000010bdff4d3 main + 1283
  9  libdyld.dylib            0x00007fff6beb1cc9 start + 1
  zsh: segmentation fault  swift file.swift
  </code></pre>
  
  <p>any ideas as to where the problem is? Thanks!</p>
  
  <p>EDIT: I have tried putting the code to Xcode and it works as it should.</p>