I wonder if App Inventor compiles directly to Java or it is using some sort of JSON or bytecode that is run to an evaluator or it compiles directly to Java. If it is compiled, what happens if variable changed types while in the code. For example: Variable is initialized with a number or a function that returns a number then the variable is changed to a string. And about list in App Inventor accepting any kind of types. About types in App Inventor, i don't know if they have a limit based on the Java type they use to store it or used a dynamic number.
When using companion app to live test your app, the companion downloads YAIL code (a form of Scheme language; generated from Blocks) and it is evaluated by the GNU Kawa interpreter.
When you download an APK, the buildserver compiles the YAIL files to Java bytecode using the GNU Kawa compiler, alongwith the runtime components library, and packages the class files and other resources into an APK.