kateinoigakukun
protocol P {} struct S: P {} struct V { static let value = V() } class Service { func perform() { let s = S() let _: Any = encodeResponse(s) } private func encodeResponse(_ s: S, indent: V = V.value) -> [String: Any] { fatalError() } private func encodeResponse<T: P>(_ response: T) -> Any { fatalError() } } let s = Service() s.perform()
Fatal error: file /usercode/main.swift, line 19 Current stack trace: 0 libswiftCore.so 0x00007f1672a4f3a0 swift_reportError + 50 1 libswiftCore.so 0x00007f1672ac0090 _swift_stdlib_reportFatalErrorInFile + 115 2 libswiftCore.so 0x00007f16729e44fe <unavailable> + 3515646 3 libswiftCore.so 0x00007f16729e4677 <unavailable> + 3516023 4 libswiftCore.so 0x00007f16727d9ddd <unavailable> + 1375709 5 libswiftCore.so 0x00007f16729bb458 <unavailable> + 3347544 6 libswiftCore.so 0x00007f16727d9179 <unavailable> + 1372537 10 swift 0x00000000005283fe <unavailable> + 1213438 11 swift 0x000000000052cce2 <unavailable> + 1232098 12 swift 0x000000000051cdbf <unavailable> + 1166783 13 swift 0x000000000050b5e8 <unavailable> + 1095144 ...