Files
swift-mirror/test/Constraints/rdar37160679.swift
Pavel Yaskevich f462521078 [ConstraintSystem] Refactor arg/param matching to handle autoclosures
Make sure that presence of `@autoclosure` attribute handled
in one place - `matchCallArguments`, which makes it possible
to remove the rest of (now redundant) autoclosure related
logic scattered throughout solver.
2018-11-10 11:59:28 -08:00

22 lines
584 B
Swift

// RUN: %target-swift-frontend -emit-sil -verify %s | %FileCheck %s
func foo(_ f: @autoclosure () -> Int) {}
func foo(_ f: () -> Int) {}
func bar(_ f: () throws -> Int) {}
func bar(_ f: () -> Int) {}
func baz(a1: @autoclosure () -> Int,
a2: () -> Int,
b1: () throws -> Int,
b2: () -> Int) {
// CHECK: function_ref @$s12rdar371606793fooyySiyXEF
foo(a1)
// CHECK: function_ref @$s12rdar371606793fooyySiyXEF
foo(a2)
// CHECK: function_ref @$s12rdar371606793baryySiyKXEF
bar(b1)
// CHECK: function_ref @$s12rdar371606793baryySiyXEF
bar(b2)
}