Files
swift-mirror/test/stdlib/Random.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

22 lines
1006 B
Swift

//===--- Random.swift -----------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
// RUN: %target-typecheck-verify-swift -verify-ignore-unrelated
struct Jawn { }
// Me, sobbing: "Look, you can't just point at an empty struct and call it a
// RandomNumberGenerator."
// Swift 5.4, pointing at this Jawn: "RNG."
extension Jawn: RandomNumberGenerator { }
// expected-error@-1 {{type 'Jawn' does not conform to protocol 'RandomNumberGenerator'}}
// expected-error@-2 {{unavailable instance method 'next()' was used to satisfy a requirement of protocol 'RandomNumberGenerator'}}