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 lots of type errors and introduces assertElement. #4885

Merged
merged 5 commits into from
Sep 9, 2016

Conversation

cramforce
Copy link
Member

  • Gets rid of many specific Element types. In practice these aren't helpful, but introduce a lot of casting.
  • Might have fixed on actualy bug in url-replacements.js

142 error(s), 6 warning(s), 93.81603250831178% typed

@cramforce
Copy link
Member Author

@erwinmombay I apologize for the overlap with your recent change!

new AssertionFunctionSpec("module$src$log.user.assert", JSType.TRUTHY),
new AssertionFunctionSpec("module$src$log.dev.assert", JSType.TRUTHY),
new AssertionFunctionSpec("Log$$module$src$log.prototype.assert", JSType.TRUTHY)
new AssertionFunctionSpec("Log$$module$src$log.prototype.assert", JSType.TRUTHY),
Copy link
Member

Choose a reason for hiding this comment

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

so we need to change this too to "AssertFunctionByTypeName" ?

Copy link
Member

@erwinmombay erwinmombay Sep 9, 2016

Choose a reason for hiding this comment

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

ah nvm, looks like that doesn't work. i was hoping AssertFunctionByTypeName solves the inference issue

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is just an utility to be able to use custom types like Element

- Gets rid of many specific `Element` types. In practice these aren't helpful, but introduce a lot of casting.
- Might have fixed on actualy bug in url-replacements.js

142 error(s), 6 warning(s), 93.81603250831178% typed
@@ -472,14 +472,15 @@ export class UrlReplacements {
: String(metric);
});
} else {
return Promise.resolve(String(metric));
return /** @type {!Promise<(string|undefined)>} */ (
Copy link
Contributor

Choose a reason for hiding this comment

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

This should just be !Promise<string>.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same reason. Unfortunately CC doesn't support complex type equivalencies on generics.

@cramforce
Copy link
Member Author

LG please :)

@erwinmombay
Copy link
Member

LGTM

@cramforce cramforce merged commit d7d493a into ampproject:master Sep 9, 2016
@cramforce cramforce deleted the types7 branch September 9, 2016 17:51
dreamofabear pushed a commit to dreamofabear/amphtml that referenced this pull request Sep 16, 2016
* Fix lots of type errors and introduces assertElement.

- Gets rid of many specific `Element` types. In practice these aren't helpful, but introduce a lot of casting.
- Might have fixed on actualy bug in url-replacements.js

142 error(s), 6 warning(s), 93.81603250831178% typed
mityaha pushed a commit to ooyala/amphtml that referenced this pull request Nov 30, 2016
* Fix lots of type errors and introduces assertElement.

- Gets rid of many specific `Element` types. In practice these aren't helpful, but introduce a lot of casting.
- Might have fixed on actualy bug in url-replacements.js

142 error(s), 6 warning(s), 93.81603250831178% typed
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