alibaba / alibaba/HandyJSON

stringImplicitlyUnwrapped 未解包问题

Open
#321 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4.3k
Forks
677
PR merge metrics
No merged PRs in 30d

Description

文档中提到:
![image](https://user-images.githubusercontent.com/1830640/56125629-f1a9e380-5fab-11e9-84c4-11f8d49b6c93.png)
```
var stringImplicitlyUnwrapped: String!
```
这里支持解包的方式,但是我实际使用中,使用一样的方式:
![image](https://user-images.githubusercontent.com/1830640/56125741-2fa70780-5fac-11e9-84b2-40c3fa192b92.png)
但是,在print出来的时候:
```
task_name: Optional("前端开发")
```
而不是
```
task_name: "前端开发"
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Reproduce the HandyJSON case with a Swift String! property and compare the printed Optional value with the documented behavior; identify whether the discrepancy is in deserialization or printing, then add a regression test that captures the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.