You are trying to mix uint with int: totalSupply is of type int while balances maps to uint.
Since your totalSupply can't ever be under zero, you should simply change that to be uint. That way you don't have to convert anything and your types are more correct.
(Answering myself two year later for those arriving here through Google Airlines):
"new" keyword is the culprit in this case.
Each time "new" is used, the full code of the referenced smart-contract will be included in order to allow to build new SubContract instances at runtime.
If just pre-built references are passed, the compiler is ...
This answer is about nightly builds in general and not specific to solidity.
A nightly build, in general, is a build of a version, that is not finished yet.
So there might be more bugs or missing features.
It is basically a build of the current work in progress.
It is called nightly build because it is common to automatically build them from the current ...
First you have to decide which solidity version you want to choose for your project. Its not necessary that you choose the latest version(my opinion). You have to consider the solidity version of external packages that you wish to use in your project.
For example, if you are using Openzeppelin, you can find different versions here: @openzeppelin/contracts.