Files
swift-mirror/test/ClangImporter/generic_compatibility_alias.swift
Henrik G. Olsson cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00

24 lines
866 B
Swift

// RUN: %empty-directory(%t)
// RUN: %build-clang-importer-objc-overlays
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -module-name generic_compat_alias -I %S/Inputs/custom-modules -typecheck -verify -verify-ignore-unrelated %s
// REQUIRES: objc_interop
// REQUIRES: OS=macosx
import ObjectiveC
import Foundation
import ObjCIRExtras
func foo(_: SwiftConstrGenericNameAlias<String>) {
// expected-error@-1 {{'SwiftConstrGenericNameAlias' requires that 'String' inherit from 'NSNumber'}}
// TODO: validate node in imported Obj-C header.
}
func faz(_: SwiftGenericNameAlias<Int>) {
// expected-error@-1 {{'SwiftGenericNameAlias' requires that 'Int' be a class type}}
// TODO: validate node in imported Obj-C header.
}
func bar(_: SwiftGenericNameAlias<NSNumber>) {} // Ok
func baz<T: AnyObject>(_: SwiftGenericNameAlias<T>) {} // Ok