Files
swift-mirror/test/ModuleInterface/closure.swift
Allan Shortlidge 7bb2d82f19 NFC: Update lit.cfg to specify -parse-as-library for module interface tests.
Tests that use the `%target-swift-emit-module-interface` lit substitution are
designed to test the behavior of the compiler when emitting module interfaces
for resilient libraries. It therefore makes sense to pass `-parse-as-library`
by default for these frontend invocations.

Fixes a few tests that were accidentally depending on parsing source files as
top level code.
2023-08-09 14:24:11 -07:00

14 lines
490 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-emit-module-interface(%t/main.swiftinterface) %s
// RUN: %target-swift-typecheck-module-from-interface(%t/main.swiftinterface)
// RUN: %FileCheck %s < %t/main.swiftinterface
// CHECK: import Swift
// CHECK: public let MyClosureVar: (Swift.Int) -> Swift.Int
public let MyClosureVar: (Int) -> Int = { $0 }
// CHECK: public let MyOtherClosureVar: (_ x: Swift.Int) -> Swift.Int
public let MyOtherClosureVar: (_ x: Int) -> Int = { x in x }