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

Fix all type errors in v0.js #4908

Merged
merged 6 commits into from
Sep 10, 2016
Merged

Fix all type errors in v0.js #4908

merged 6 commits into from
Sep 10, 2016

Conversation

cramforce
Copy link
Member

@cramforce cramforce commented Sep 9, 2016

Fixed all errors and made all relevant warnings errors and fixed them all :)

Turns on type checking for v0.js on travis.

New status.
99 error(s), 6 warning(s), 93.87904883060965% typed
@cramforce
Copy link
Member Author

@dvoytenko Could you check the changes to resources, fixed-layer and url-replacements?

return dev().assert(Resource.forElementOptional(element),
'Missing resource prop on %s', element);
return /** @type {!Resource} */ (
dev().assert(Resource.forElementOptional(element),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't get ! from assert?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug in our CC implementation. Will fix with @erwinmombay

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this used to work, but regressed with the dev() changes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah type inference system for asserts dont work with dev().assert(). no quick solution yet

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type inference seems to be having issues in general. Not sure exactly what
is going on.

On Fri, Sep 9, 2016 at 4:29 PM, erwin mombay notifications@github.com
wrote:

In src/service/resource.js
#4908 (comment):

@@ -74,8 +74,9 @@ export class Resource {
* @return {!Resource}
*/
static forElement(element) {

  • return dev().assert(Resource.forElementOptional(element),
  •    'Missing resource prop on %s', element);
    
  • return /** @type {!Resource} */ (
  •    dev().assert(Resource.forElementOptional(element),
    

yeah type inference system for asserts dont work with dev().assert(). no
quick solution yet


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ampproject/amphtml/pull/4908/files/9dc6e433e9326d421095feb7f85465681e43f296#r78263228,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFeT3b9_Zxya-0DqG_4Qwgon8hre5vVks5qoevSgaJpZM4J5hjb
.

0 error(s), 21 warning(s), 94.03821780247635% typed
@cramforce cramforce changed the title Fix more type errors Fix all type errors in v0.js Sep 9, 2016
@dvoytenko
Copy link
Contributor

LGTM on my side.

@cramforce
Copy link
Member Author

@jridgewell Had to turn off SW compilation. Will look into it.

- Turn off compilation of sw due to warnings.
@cramforce cramforce mentioned this pull request Sep 10, 2016
@cramforce
Copy link
Member Author

Have a green build in https://travis-ci.org/ampproject/amphtml/builds/158915579 and will take @dvoytenko's LGTM

Others, please take a look. In particular for stuff that I didn't do perfectly since this had to get in quickly, so we have type checking on travis.

@cramforce cramforce merged commit 74dcf8e into ampproject:master Sep 10, 2016
@cramforce cramforce deleted the types8 branch September 10, 2016 05:13
@@ -98,6 +98,7 @@ protected AmpCommandLineRunner(String[] args) {
protected CompilerOptions createTypeCheckingOptions() {
CompilerOptions options = super.createOptions();
options.setCheckTypes(true);
options.setInferTypes(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it help any?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, tested w/ and w/o and didn't see any difference. (test done with your PR)

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.

3 participants