Files
swift-mirror/test/SourceKit/ConformingMethods/rdar141168628.swift
Hamish Knight 30a8f1988a [SourceKit] Use canonical type in printTypeUSR
Mangling a non-canonical type can run into
unexpected type sugar such as the newly introduced
LocatableType. USRs should be based on canonical
types anyway, so make sure we canonicalize before
mangling.

rdar://141168628
2024-12-09 22:04:10 +00:00

17 lines
383 B
Swift

@resultBuilder struct Builder {
static func buildBlock<T>(_ x: T) -> T { x }
}
struct S {}
struct R<T> {
init(@Builder fn: () -> T) {}
}
// rdar://141168628 - Make sure we can compute the USR here without crashing.
R {
S()
// RUN: %sourcekitd-test -req=conformingmethods -pos %(line + 1):2 %s -- %s | %FileCheck %s
}
// CHECK: key.typeusr: "$s13rdar1411686281RVyAA1SVGD"