Files
swift-mirror/test/Sema/Inputs/diag_non_ephemeral_module1.swift
Hamish Knight e7fe2a7a48 Prevent non-ephemeral fix from affecting overload resolution
This commit changes the behaviour of the error for
passing a temporary pointer conversion to an
@_nonEphemeral parameter such that it doesn't
affect overload resolution. This is done by recording
the fix with an impact of zero, meaning that we don't
touch the solution's score.

In addition, this change means we no longer need
to perform the ranking hack where we favour
array-to-pointer, as the disjunction short-circuiting
will continue to happen even with the fix recorded.
2019-11-03 08:42:26 -08:00

40 lines
778 B
Swift

public struct ResilientStruct {
public static var staticStoredProperty: Int8 = 0
public var storedProperty: Int8 = 0
public init() {}
}
@frozen
public struct FragileStruct {
@_fixed_layout
public static var staticStoredProperty: Int8 = 0
public var storedProperty: Int8 = 0
public init() {}
}
public final class ResilientFinalClass {
public var storedProperty: Int8 = 0
public init() {}
}
@_fixed_layout
public final class FragileFinalClass {
public var storedProperty: Int8 = 0
public init() {}
}
public var globalResilient: Int8 = 0
@_fixed_layout
public var globalFragile: Int8 = 0
@_fixed_layout
public var overloadedVar = 0
@_fixed_layout
public var overloadedVarOnlyOneResilient = 0
@_fixed_layout
public var overloadedVarDifferentTypes = 0