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

RFC: untyped(expr) for untyped params in overloaded routines #630

Open
timotheecour opened this issue Feb 28, 2021 · 0 comments
Open

RFC: untyped(expr) for untyped params in overloaded routines #630

timotheecour opened this issue Feb 28, 2021 · 0 comments
Labels

Comments

@timotheecour
Copy link
Owner

timotheecour commented Feb 28, 2021

proposal:

add untyped typeclass, useful for overload resolution.

Example

proc fn(a: untyped): untyped = 1
proc fn(a: typed): untyped = 2
proc fn(a: int): untyped = 3

assert fn(nonexistant.untyped) == 1
assert fn(nonexistant) # CT error
assert fn("abc") == 2
assert fn(2) == 3
assert fn(2.untyped) == 1

assert untyped(nonexistant) is untyped
assert untyped(2) is untyped

links

@timotheecour timotheecour changed the title well typed untyped arguments well-typed untyped arguments Feb 28, 2021
@timotheecour timotheecour changed the title well-typed untyped arguments untyped typeclass Feb 28, 2021
@timotheecour timotheecour changed the title untyped typeclass RFC: untyped(expr) Feb 28, 2021
@timotheecour timotheecour changed the title RFC: untyped(expr) RFC: untyped(expr) for untyped params in overloaded routines Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant