Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't change the type of variable string in global scope from String to List[String] #21

Closed
notzoom opened this issue Dec 21, 2017 · 1 comment
Labels

Comments

@notzoom
Copy link

notzoom commented Dec 21, 2017

Trying to translate this Python program to JS:

string = "I am fine"

string = string.split(" ")

string = string[0]

What I get is:
can't change the type of variable string in global scope from String to List[String]

@notzoom notzoom changed the title Another Important Error can't change the type of variable string in global scope from String to List[String] Dec 21, 2017
@alehander92
Copy link
Collaborator

That's intended.

s = "I am fine"
l = s.split(" ")
s = l[0]
print(s)

works

Pseudo translates only a limited subset of Python which is statically typed.
You don't write any types, because it has full type inference, but changing the type of a variable is forbidden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants