-
Notifications
You must be signed in to change notification settings - Fork 588
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
Substr length should not have a default #5757
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this requires changes to cpp?
@@ -244,7 +244,7 @@ declare interface String { | |||
* @param start first character index; can be negative from counting from the end, eg:0 | |||
* @param length number of characters to extract | |||
*/ | |||
//% shim=String_::substr length.defl=10 | |||
//% shim=String_::substr | |||
//% help=text/substr | |||
//% blockId="string_substr" block="substring of %this=text|from %start|of length %length" blockNamespace="text" | |||
substr(start: number, length?: number): string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you want to change this param to be non-optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
Fix for microsoft/pxt-arcade#1125