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-1632] Can't create an empty array with shorthand syntax #44241

Closed
DevAndArtist mannequin opened this issue May 27, 2016 · 1 comment
Closed

[SR-1632] Can't create an empty array with shorthand syntax #44241

DevAndArtist mannequin opened this issue May 27, 2016 · 1 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

Comments

@DevAndArtist
Copy link
Mannequin

DevAndArtist mannequin commented May 27, 2016

Previous ID SR-1632
Radar None
Original Reporter @DevAndArtist
Type Bug
Status Resolved
Resolution Duplicate
Environment

Xcode 7.3.1
Swift 2.2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: 9e0c17101b628af37ddaf9d24e600656

duplicates:

  • SR-773 Using Array initializer syntax with nested types causes bad error message

Issue Description:

// this should create an empty Array<Swift.String> 
// but the compiler tries to creates Array<Swift.String.Type> instead
// and yells to remove `()`
var array = [Swift.String]() 

I believe this is a bug where `.self` magic confuses the compiler.

@belkadan
Copy link
Contributor

Effectively the same as SR-773.

@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

1 participant