|
|
|
|
|
by willtim
2119 days ago
|
|
> should the language catch us making a type error here? With a statically typed language, the choice is up to you. Every statically typed language is just a "dynamically typed" language with the ability to statically assign types. For example, you can type the variable as an "Int" or for more runtime flexibility, a "Variant" (if using C++). |
|
int q // q is considered a hole of int type
q <- // but we're typing "hello" there
Practicalities ask for the situation to be considered a problem - not of incorrectly plugged hole (when into "int" place you're putting "string" value), but of incorrectly previously stated type (it's the original "int q" which is wrong, should have been "string q").