struct Foo{T}
a::T
b::T
Foo(a::T) where T = new{T}(a, a^2)
end
methods(Foo)
methods(Foo{Int})
struct Foo{T}
a::T
b::T
Foo(a::T) where T = new{T}(a, a^3)
end
methods(Foo)
methods(Foo{Int})
struct Foo{T}
a::T
b::T
Foo(a::T) where T = new{T}(a, a^3)
Foo(a::T, b::T) where T = new{T}(a, b)
end
methods(Foo)
methods(Foo{Int})
struct Foo{T}
a::T
b::T
end
methods(Foo)
methods(Foo{Int})
Foo(2)
Foo{Int64}(2, 8)
Foo(2, 8)
Foo{Int64}(2, 8)
Foo(2) == Foo(2, 8)
true