-
Notifications
You must be signed in to change notification settings - Fork 676
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
Strong mode code excerpt tests for main page #590
Conversation
Contributes to #407
3f330c5
to
2201a36
Compare
2201a36
to
f7f64cc
Compare
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.
Thank you for taking such care with this page and finding those issues! I have a few suggestions for wording, but otherwise LGTM.
@@ -6,6 +6,7 @@ void miscDeclAnalyzedButNotTested() { | |||
// #docregion integer-literals | |||
int x = 1; | |||
int hex = 0xDEADBEEF; | |||
// ignore_for_file: 2, integer_literal_out_of_range | |||
int bigInt = 34653465834652437659238476592374958739845729; |
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.
Should we remove/alter bigInt
?
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.
Good question. How about we keep it for this PR, and then generally decide how to document https://github.com/dart-lang/sdk/blob/master/sdk/lib/core/bigint.dart?
src/_guides/language/sound-dart.md
Outdated
checkbox. | ||
Gist: https://gist.github.com/3c7c95683f0c06be8326a2fd3975cd19 | ||
DartPad url: https://dartpad.dartlang.org/3c7c95683f0c06be8326a2fd3975cd19 | ||
Note: Can't use embedded DP because DP |
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.
DP -> DartPad (even though it's not visible...)
Also... Let's use a string (waiting-for-dartpad-2?) to make it easy to find DartPad-worthy places that are waiting for full Dart 2 support.
src/_guides/language/sound-dart.md
Outdated
|
||
class Cat extends Animal {} | ||
For example, the following code throws an exception at runtime because it is an error |
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.
"For example, ..." seems out of context with the warning moved up there.
Let's move the aside to be after the code.
src/_guides/language/sound-dart.md
Outdated
{% endprettify %} | ||
|
||
In the last example, `x` is inferred as double using downward information. | ||
The return type of the closure is inferred as int using upwards information. |
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.
GLOBAL: upwards -> upward
(Not your spelling, I know, but the doc uses downward elsewhere, and we should be consistent. Since https://developers.google.com/style/word-list specifies backward instead of backwards, I've taken to favoring "ward" without the "s" for similar words.)
src/_guides/language/sound-dart.md
Outdated
{% endprettify %} | ||
|
||
In the last example, `x` is inferred as double using downward information. |
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.
We should either use code font for double
and int
here, or not code font <int>
.
src/_guides/language/sound-dart.md
Outdated
{% endprettify %} | ||
|
||
In the last example, `x` is inferred as double using downward information. | ||
The return type of the closure is inferred as int using upwards information. | ||
The type argument to `map()` is inferred as `<int>` using upwards information. |
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.
Can we connect these a bit more? Here's a try:
The return type.... Dart uses this return type as upward information when inferring the map()
method's type argument: <int>
.
|
||
feedAnimals(myCats); | ||
} | ||
List<Cat> myCats = new List<[!MaineCoon!]>(); |
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.
Before this, please add the comment that was there before:
// Was: List<Cat> myCats = new List<Cat>();
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.
Sure but I don't think that it is relevant to the presentation. What is being contrasted in the code excerpt is the type argument to List
on the LHS vs. the type argument to List
on the RHS.
I'll leave out the comment for now and I'll revisit later if you feel the need.
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.
The text "In the following example, you can substitute new List<Cat>()
with new List<MaineCoon>()
" refers to code (new List<Cat>()
) that I actually looked above to find, since it seemed to be saying that I'd seen that code before. Having the comment there made me not bother searching. We could also just word it differently.
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.
Contributes to #407
Staged at https://dartlang-org-staging-0.firebaseapp.com/guides/language/sound-dart