Implicitly typed constants #4863
Unanswered
ekolis
asked this question in
Language Ideas
Replies: 2 comments
-
This is something the language team avoiding. A numeric literal doesn't points its type obviously. The same rule for fields applies to constants (requiring explicit type). |
Beta Was this translation helpful? Give feedback.
0 replies
-
See #106. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I can say:
var Age = 18;
However I can't say:
const Age = 18;
I have to specify the type of the constant explicitly:
const int Age = 18;
How about allowing for implicitly typed constants so that the type specification can be optional?
Beta Was this translation helpful? Give feedback.
All reactions