You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
Quark compiles code that adds elements to a list that has not been initialized but the generated code throws errors in all languages.
Quark code:
package likes{
class Color {
List<String> favorites;
}
}
void main() {
int i=0;
likes.Color myColors=new likes.Color();
myColors.favorites.add("red");
myColors.favorites.add("green");
myColors.favorites.add("blue");
myColors.favorites.add("purple");
...
}
Error in Javascript:
/Users/janicekarin/quark-examples/javascript/list.js:9
((myColors).favorites).push("red");
^
TypeError: Cannot read property 'push' of null
at main (/Users/janicekarin/quark-examples/javascript/list.js:9:27)
at Object.<anonymous> (/Users/janicekarin/quark-examples/javascript/list.js:25:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Error in Python:
File "list.py", line 26, in <module>
main()
File "list.py", line 10, in main
((myColors).favorites).append("red");
AttributeError: 'NoneType' object has no attribute 'append'
in Java:
Exception in thread "main" java.lang.NullPointerException
at Functions.main(Functions.java:5)
at Functions.main(Functions.java:20)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Quark compiles code that adds elements to a list that has not been initialized but the generated code throws errors in all languages.
Quark code:
Error in Javascript:
Error in Python:
in Java:
The text was updated successfully, but these errors were encountered: