Skip to content

Fix test/Interpreter/dynamic_replacement_opaque_result.swift #26129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions test/Interpreter/Inputs/dynamic_replacement_opaque1.swift
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
protocol P {
func myValue() -> Int
func myValue() -> Int64
}

extension Int: P {
public func myValue() -> Int {
extension Int64: P {
public func myValue() -> Int64 {
return self
}

}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
func bar(_ x: Int) -> some P {
func bar(_ x: Int64) -> some P {
return x
}

struct Container {
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
func bar(_ x: Int) -> some P {
func bar(_ x: Int64) -> some P {
return x
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
var computedProperty : some P {
get {
return 2
return Int64(2)
}
set {
print("original \(newValue)")
Expand All @@ -33,7 +33,7 @@ struct Container {
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
subscript(_ x: Int) -> some P {
get {
return 2
return Int64(2)
}
set {
print("original \(newValue)")
Expand All @@ -45,7 +45,7 @@ protocol Q {}

struct NewType : Q {}

extension Int : Q {}
extension Int64 : Q {}

public protocol Assoc {
associatedtype A = Int
Expand All @@ -56,6 +56,6 @@ public protocol Assoc {
struct Test : Assoc {
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
func act() -> some Q {
return 1
return Int64(1)
}
}
10 changes: 5 additions & 5 deletions test/Interpreter/Inputs/dynamic_replacement_opaque2.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
@_private(sourceFile: "TestOpaque1.swift") import TestOpaque1

struct Pair : P {
var x = 0
var y = 1
func myValue() -> Int{
var x = Int64(0)
var y = Int64(1)
func myValue() -> Int64 {
return y
}
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@_dynamicReplacement(for:bar(_:))
func _replacement_bar(y x: Int) -> some P {
func _replacement_bar(y x: Int64) -> some P {
return Pair()
}

extension Container {
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@_dynamicReplacement(for:bar(_:))
func _replacement_bar(y x: Int) -> some P {
func _replacement_bar(y x: Int64) -> some P {
return Pair()
}

Expand Down