Files
swift-mirror/test/IRGen/generic_structs.swift
Slava Pestov 85b94a4300 SILGen: Refactor emitMemberInitializers() to use Initialization
Instead of constructing an LValue and storing the result of the
stored property initializer to the lvalue, let's emit the call
of the stored property initializer directly into an initialization
pointing at the stored properties named by the pattern.
2020-10-11 12:48:30 -04:00

40 lines
514 B
Swift

// RUN: %target-swift-frontend -disable-type-layout -primary-file %s -emit-ir
struct A<T1, T2>
{
var b: T1
var c: T2
var d: B<T1, T2>
}
struct B<T1, T2>
{
var c: T1
var d: T2
}
struct C<T1>
{}
struct D<T2>
{}
struct Foo<A1, A2>
{
var a: A1
var b: Bar<A1, A2>
}
struct Bar<A1, A2> {
}
public protocol Proto { }
public struct EmptyStruct {}
public struct GenericStruct<T : Proto> {
var empty: EmptyStruct = EmptyStruct()
var dummy: Int = 0
var opt: Optional<T> = nil
public init() {}
}