Skip to content
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

internal struct constructor applies convert even when argument already satisfies type assertion #50627

Open
sadish-d opened this issue Jul 21, 2023 · 0 comments
Labels
domain:types and dispatch Types, subtyping and method dispatch

Comments

@sadish-d
Copy link

instance = (a=NaN,)
type = NamedTuple{(:a,), Tuple{A}} where A<:Real # abstract type

instance::type # confirms that instance is of type

struct F
    x::type
    F(x::type=instance) = new(x)
end
F() # applies `convert` and gives error - UndefVarError: `T` not defined

possibly related issue: #50626 (comment)

context: discourse discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

2 participants