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

added Fact check for Head/Tail #451

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

filipw
Copy link
Contributor

@filipw filipw commented Jul 11, 2023

Added a fact check for Head/Tail array functions, which improves a bit the feedback.

let foo : Int[] = [];
let bar = Head(foo);

current error: ERROR: runtime error: index out of range: 0
new error: ERROR: runtime error: program failed: Array must have at least 1 element

let foo : Int[] = [];
let bar = Tail(foo);

current error: ERROR: runtime error: value cannot be used as an index: -1
new error: ERROR: runtime error: program failed: Array must have at least 1 element


Regarding for the trailing whitespace changes - VS Code cleaned it up "on its own" due to "editor.formatOnType": true setting - but I kept them because they seem anyway to be consistent with the rest of the codebase.

@DmitryVasilevsky DmitryVasilevsky merged commit 19fb576 into microsoft:main Jul 14, 2023
@DmitryVasilevsky
Copy link
Contributor

Approved and merged. Thank you!

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