`toTyped` ignores default values in class
- Dominant language
- Java
- Stars
- 11.5k
- Forks
- 402
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 20
Description
Given
```
class Bird {
name: String = "DEFAULT"
colloquialName: String = name
}
```
evaluating
```
new Dynamic { name = "Pigeon" }.toTyped(Bird)
```
results in
```
new Bird {
name = "Pigeon"
colloquialName = "DEFAULT" // <- unexpected
}
```
The same holds for the `toTyped` definition on `Map`, so the following produces the same result:
```
new Dynamic { name = "Pigeon" }.toMap().toTyped(Bird)
```
Contributor guide
Research direction
No source file or test is named in the issue. Reproduce the examples for Dynamic.toTyped and Map.toTyped, then trace their handling of class defaults; done means both conversions preserve the supplied name while deriving colloquialName from it rather than using the declared default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100