source-academy / js-slang

Implementations of sublanguages of JavaScript, TypeScript, Scheme and Python
https://source-academy.github.io/source/
Apache License 2.0
64 stars 102 forks source link

Function types in Source Typed #1683

Open martin-henz opened 2 months ago

martin-henz commented 2 months ago

Should declarations inherit the type of their right-hand side?

Example:

let a: number = 1;

let b = a;

b = "a string";

does not give a type error in Source Typed.