I have been thinking about this problem for a very long time.
Can the compiler prove that two pieces of code are syntactically or semantically equivalent?
For example, can we say that the following versions of some code are equivalent?
// Some.swift
struct Bar {
let value : Int
}
func transform (bar: Bar ) -> Foo {
return Foo (code: bar.value)
}
struct Foo {
let code : Int
}
// Some.swift
func transform (bar: Bar ) -> Foo {
return Foo (code: bar.value)
}
struct Foo {
let code : Int
}
struct Bar {
let value : Int
}
// Some.swift
struct Foo {
let code : Int
}
struct Bar {
let value : Int
}
func foo (from bar: Bar ) -> Foo {
return Foo (code: bar.value)
}