Files
swift-mirror/test/Serialization/opaque_nested.swift
Ben Barham fda96eb8a0 [Serialization] Skip opaque types nested in skipped function bodies
Opaque types are gathered and visited separately. As with local types,
only serialize them if they are not within a skipped function body.

Fixes a crash caused when compiling the primary file, where delayed
parsing is explictly disabled.

Resolves rdar://73167790
2021-01-15 07:30:48 +10:00

22 lines
738 B
Swift

// RUN: %target-build-swift -Xfrontend -disable-availability-checking -emit-module -module-name A -Xfrontend -experimental-skip-all-function-bodies -Xfrontend -debug-forbid-typecheck-prefix -Xfrontend NEVERTYPECHECK %s
// RUN: %target-build-swift -Xfrontend -disable-availability-checking -emit-module -module-name A -Xfrontend -experimental-skip-non-inlinable-function-bodies -Xfrontend -debug-forbid-typecheck-prefix -Xfrontend NEVERTYPECHECK %s
protocol Base {
func anything()
}
func test() {
struct Nested : Base {
let NEVERTYPECHECK_property = 1
func anything() {
let NEVERTYPECHECK_local = 1
}
func opaqueReturnType() -> some Base {
let NEVERTYPECHECK_local = 1
return Nested()
}
}
}