|
It was only when I ran the compiled program and saw an exception thrown in my face that I realized I had used a non-existent method. There wasn't even a single warning at compile time. Why? |
Answered by
arakov
Sep 21, 2025
Replies: 1 comment
|
ELENA is a dynamic language so it is expected behavior. You can send any message to any object. But still it is possible to get warning in that case. To do it you have to use strong-typed variables / fields / parameters. Here an example: The output is: So there is a warning. But if your declare a weak variable: There will be no warning In general, you have to use var only if you need a weak type. Otherwise you can use either explicit type of auto |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ELENA is a dynamic language so it is expected behavior. You can send any message to any object. But still it is possible to get warning in that case. To do it you have to use strong-typed variables / fields / parameters.
Here an example:
The output is:
So there is a warning. But if your declare a weak…