Skip to content

[CodeSynthesis] Make sure that LazyInitializerExpr has a type #21441

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
merged 1 commit into from
Dec 19, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Dec 19, 2018

Currently when LazyInitializerExpr is added to the AST it's not
given an explicit type. Because of that constraint solver silently
fails in contraint generator without diagnostic. But since
sub-expression associated with LazyInitializerExpr is already
type-checked it makes sense to set its type explicitly.

@xedin xedin requested a review from rjmccall December 19, 2018 21:21
@xedin
Copy link
Contributor Author

xedin commented Dec 19, 2018

@rjmccall I've added a type to LazyInitializerExpr and left a fallback to type-variable just in case.

@rjmccall
Copy link
Contributor

I'm a little uncomfortable with the fallback; it seems like something we should be asserting.

@xedin
Copy link
Contributor Author

xedin commented Dec 19, 2018

@rjmccall sure, I can make this is a assert. It's just in general we create a type variable in place of missing type to attempt to infer it.

@xedin xedin force-pushed the fix-lazy-init-expr-csgen branch from 90331a0 to d07e317 Compare December 19, 2018 21:40
@xedin
Copy link
Contributor Author

xedin commented Dec 19, 2018

@rjmccall Alright, I've converted type variable to assert.

@xedin
Copy link
Contributor Author

xedin commented Dec 19, 2018

@swift-ci please smoke test

Currently when `LazyInitializerExpr` is added to the AST it's not
given an explicit type. Because of that constraint solver silently
fails in contraint generator without diagnostic. But since
sub-expression associated with `LazyInitializerExpr` is already
type-checked it makes sense to set its type explicitly.
@xedin xedin force-pushed the fix-lazy-init-expr-csgen branch from d07e317 to 20b7c2a Compare December 19, 2018 22:04
@xedin
Copy link
Contributor Author

xedin commented Dec 19, 2018

@swift-ci please smoke test

@xedin xedin merged commit f85bb3e into swiftlang:master Dec 19, 2018
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.

2 participants