Skip to content

Conversation

@Abdullahjavednesar
Copy link
Collaborator

Handling Exceptions when str slicing index in non integer

Example:

def f():
  s: str
  s = "01234"
  print(s[1:2.2])

Now throws error while calling f()

semantic error: slice indices must be integers or None
  |
4 |     print(s[1:2.2])
  |               ^^^ 

@certik certik merged commit aa8858d into lcompilers:main Apr 10, 2022
@certik
Copy link
Contributor

certik commented Apr 10, 2022

I think this looks great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants