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

[SR-11998] can't declare implicitly unwrapped optional of type with inferred generic parameters #54432

Closed
marcrasi mannequin opened this issue Jan 7, 2020 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@marcrasi
Copy link
Mannequin

marcrasi mannequin commented Jan 7, 2020

Previous ID SR-11998
Radar rdar://problem/58455441
Original Reporter @marcrasi
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee @DougGregor
Priority Medium

md5: c1e36f49a5241c93c0abf6cec90bfad7

Issue Description:

struct Generic<T> {}
let _: Generic! = Generic<Int>()

On Ubuntu 18.04 development snapshot 2020-01-03, this compiles without error.
On Ubuntu 18.04 development snapshot 2020-01-04 and later, this produces an error:

workspace/iuo.swift:2:8: error: using '!' is not allowed here; perhaps '?' was intended?
let _: Generic! = Generic<Int>()

If you do `let _: Generic<Int>! = Generic<Int>()` instead, then there is no error.

@beccadax
Copy link
Contributor

beccadax commented Jan 9, 2020

@swift-ci create

@beccadax
Copy link
Contributor

This reproduces on macOS, too. I think this is a regression caused by #29005.

(Thank you for tracing it down to a specific snapshot! That probably saved me an hour of work.)

@DougGregor
Copy link
Member

Fixed by #30496

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants