Skip to content

Commit f468377

Browse files
committed
---
yaml --- r: 347983 b: refs/heads/master c: ef0b2a4 h: refs/heads/master i: 347981: 5ac017b 347979: 0e669bb 347975: f5e34da 347967: 4f2c13d
1 parent 0618585 commit f468377

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 07353a13b2aa08b354a3308720b1bf210d402067
2+
refs/heads/master: ef0b2a45d0d6c35e392740b1da5385a7b1194e3e
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/Sema/CodeSynthesis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,6 +2722,7 @@ swift::createDesignatedInitOverride(TypeChecker &tc,
27222722
auto paramTy = decl->getInterfaceType();
27232723
auto substTy = paramTy.subst(subMap, SubstFlags::UseErrorType);
27242724
decl->setInterfaceType(substTy);
2725+
decl->getTypeLoc() = TypeLoc::withoutLoc(substTy);
27252726
}
27262727

27272728
// Create the initializer declaration, inheriting the name,

trunk/test/ParseableInterface/default-args.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class Derived: Base {
2828
}
2929

3030
// CHECK-NOT: init(convInit: Int = super)
31-
// CHECK: override {{(public )?}}init(x: Int = super)
31+
// CHECK: override {{(public )?}}init(x: {{(Swift.)?}}Int = super)
3232
// CHECK-NOT: init(convInit: Int = super)
3333
}
3434

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
4+
// RUN: %FileCheck %s < %t/main.swiftinterface
5+
6+
// RUN: %target-build-swift %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
7+
// RUN: %FileCheck %s < %t/main.swiftinterface
8+
9+
// RUN: %target-build-swift %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution -wmo
10+
// RUN: %FileCheck %s < %t/main.swiftinterface
11+
12+
// This test makes sure that we substitute uses of the superclass's generic
13+
// parameters when we inherit initializers.
14+
15+
// CHECK: public class Base<In, Out> {
16+
public class Base<In, Out> {
17+
// CHECK-NEXT: public init(x: @escaping (In) -> Out)
18+
public init(x: @escaping (In) -> Out) {}
19+
// CHECK: }
20+
}
21+
22+
// CHECK: public class Derived<T> : {{(main.)?}}Base<T, T> {
23+
public class Derived<T> : Base<T, T> {
24+
// CHECK-NEXT: override public init(x: @escaping (T) -> T)
25+
// CHECK: }
26+
}
27+

trunk/test/ParseableInterface/modifiers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class Base {
6969
// CHECK-LABEL: public class SubImplicit : {{(Test[.])?Base}} {
7070
public class SubImplicit: Base {
7171
// CHECK-NEXT: @objc override public init(){{$}}
72-
// CHECK-NEXT: @objc required public init(x: [[INT]]){{$}}
72+
// CHECK-NEXT: @objc required public init(x: Swift.Int){{$}}
7373
// CHECK-NEXT: @objc deinit{{$}}
7474
} // CHECK-NEXT: {{^}$}}
7575

0 commit comments

Comments
 (0)