-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[TODO] type outType = type(10)
prints as int literal(10)
instead of int
#8704
Comments
Maybe we need a
and maybe it can be extended to parameters constraints like {call} as well. |
maybe the new proc typeof*(x: untyped; mode: TypeOfMode = typeOfIter) |
This is not a bug, it is a feature. The type of |
@krux02 but that feature seems buggy, for example this code prints: iterator (): int literal(10){.inline, noSideEffect, gcsafe, locks: 0.} instead of: iterator (): int {.inline, noSideEffect, gcsafe, locks: 0.} iterator fun(): auto =
var x = 12
yield 10
yield 20
yield x
echo type(fun) here's another case; I fail to see the logic / consistency:
echo type(10)
type T = type(10)
echo T
echo type(10.2)
type T2 = type(10.2)
echo T2 prints: int
int literal(10)
float64
float64 |
type outType = type(10)
prints as int literal(10)
instead of int
type outType = type(10)
prints as int literal(10)
instead of int
the 1st bug (
echo outType.name
shown asint literal(10)
) looks newit happens with
case1
; doesn't happen withcase2
(ie only happens with litterals)the subsequent ones could be due to #8569
The text was updated successfully, but these errors were encountered: