-
Notifications
You must be signed in to change notification settings - Fork 147
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
Fix AS Migration Guide upcasting code snippet #70
Conversation
@@ -91,19 +91,19 @@ maybeValue.aMethod(); | |||
ولكن في الإصدار الأحدث ، نظرًا لأن القيمة nullable ، فإنها تتطلب منك التحقق ، مثل هذا: | |||
|
|||
```typescript | |||
let maybeValue = load() | |||
let maybeValue = load(); |
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.
As mentioned on Slack, we should fix the translations on Crowdin instead of in this PR. I will take care of it when this PR is merged, but can you please revert your changes to non-English files?
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.
Done.
@@ -91,19 +91,19 @@ maybeValue.aMethod(); | |||
However on the newer version, because the value is nullable, it requires you to check, like this: | |||
|
|||
```typescript | |||
let maybeValue = load() | |||
let maybeValue = load(); |
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.
As mentioned on Slack, please run Prettier (with yarn prettier
) and you'll see that the semicolons are automatically removed.
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've removed all semicolons!
``` | ||
|
||
```typescript | ||
// upcasting on class inheritance | ||
class Bytes extends Uint8Array {} | ||
|
||
let bytes = new Bytes(2) < Uint8Array > bytes // same as: bytes as Uint8Array |
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.
This is how Prettier will reformat these two lines of code (presumably a bug), so maybe change them to something like:
let bytes = new Bytes(2)
// `<Uint8Array>bytes` is equivalent to `bytes as Uint8Array`
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.
Fixed!
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.
See my comments above. Thank you! 💪
c6aaa69
to
cc418c2
Compare
At some point in the internationalization of the docs, some code got it's formatting broken.
This PR fixes this issue only for the AssemblyScript Migration Guide.
Some of the fixes include: