Skip to content

Push ValueDecl::{has,get,set}Type() down to VarDecl #6018

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

Merged

Conversation

slavapestov
Copy link
Contributor

ValueDecl::getInterfaceType() was added more than three years ago in this commit by @DougGregor: 12e228c

And now, as planned, it can finally replace ValueDecl::getType().

Next steps here for the curious:

  • asserting in VarDecl::getType() if called on a var that's not in local context
  • cleaning up ParamDecl validation and ensuring all ParamDecls have an interface type assigned

After recent changes, this asserts on all decls that are not VarDecls,
so we can just enforce that statically now. Interestingly, this turns
up some dead code which would have asserted immediately if called.

Also, replace AnyFunctionRef::getType() with
AnyFunctionRef::getInterfaceType(), since the old
AnyFunctionRef::getType() would just assert when called on
a Decl.
@slavapestov slavapestov force-pushed the finish-removing-value-decl-get-type branch from 5e3481e to 26c8042 Compare December 2, 2016 03:28
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit a17eec5 into swiftlang:master Dec 2, 2016
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.

1 participant