Skip to content

[TypeChecker] NFC: Add a test-case for expression affected by rdar://61749633 #37246

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

xedin
Copy link
Contributor

@xedin xedin commented May 4, 2021

No description provided.

@xedin
Copy link
Contributor Author

xedin commented May 4, 2021

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented May 4, 2021

@swift-ci please smoke test Windows platform

}

func test(a: A?) {
let _ = a?[A] // Ok
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we accept this by mistake? I guess we should at least warn about the missing “.self” instead of making it an error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think it was just an oversight but fixing a crash make this fail to type-check suggesting .self which is a source compatibility regression unfortunately... I'll try to figure out how to make it a warning in MiscDiagnostics but for that I'd need access to whole parent AST and not just an immediate parent expr...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once revert of a revert lands I'm going to adjust this to report an error with a fix-it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revert has been merged and test-case is now going to fail with fix-its.

@xedin xedin force-pushed the test-case-for-valid-type-arg-of-subscript branch from a76e904 to 3b54fdb Compare May 4, 2021 21:59
@xedin xedin changed the title [TypeChecker] NFC: Add a test-case fixed by revert of rdar://77457640 [TypeChecker] NFC: Add a test-case for expression affected by rdar://61749633 May 4, 2021
@xedin
Copy link
Contributor Author

xedin commented May 4, 2021

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented May 5, 2021

@swift-ci please smoke test macOS platform

@xedin xedin merged commit 1d5e3d4 into swiftlang:main May 5, 2021
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