[SR-9626] Unexpected behavior of static constructor's type inference #52072
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Environment
macOS Mojave Version 10.14.2 (18C54)
Xcode Version 10.1 (10B61)
Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Additional Detail from JIRA
md5: b4bfa621d7cc84553991cf9637b2262b
Issue Description:
1. Given a base class, it's subclass, a generic struct and a generic func we can have this arrangement:
This works as expected. Though there are 2 easy ways to break the result of `func test`.
2.1. Adding a type constraint on `func test`:
2.2. Adding a type constraint on `Box`:
What's even more unexpected is that adding another func named `test` to 2.1. and 2.2. changes the result back to `SubClass.Type`:
3.1. Adding anoter `func test` to 2.1:
3.2. Adding anoter `func test` to 2.2:
The text was updated successfully, but these errors were encountered: