Comments (3)
+1
At the very least generic types should be skipped for processing (potentially with a warning) instead of erroring.
from easyjson.
+1
Do you have any plans for it?
from easyjson.
Are there any updates ?
There are some problems with types when try to generate code that contains generics with pointer types.
Example:
package some_package;
//easyjson:json
type SecondNested struct {
SomeField bool `json:"someField"`
}
type NestedStruct[U json.Unmarshaler] struct {
SecondNested U `json:"secondNested"`
}
type Main[U json.Unmarshaler] struct {
NestedStructs NestedStruct[U] `json:"nested"`
}
//easyjson:json
type SomeType struct {
Main[*SecondNested]
}
Generated code:
func easyjson<...>SecondNested(in *jlexer.Lexer, out *NestedStruct[*some_package.SecondNested]) {}
func easyjson<...>SecondNested(out *jwriter.Writer, in NestedStruct[*some_package.SecondNested]) {}
Problem is at this type *some_package.SecondNested, there must not be some_package in type declaration.
from easyjson.
Related Issues (20)
- Bootstrap failed: 1:34: expected ']', found 16 (and 4 more errors) HOT 2
- Mail.ru хорошие люди
- MarshalToWriter does not pool buffers since Go 1.17
- Detailed unmarshalling error information
- go1.18
- Struct with embedding struct pointer set to nill causes panic HOT 1
- easyjson didn't generate all data. MFTI/perfomance/json example HOT 1
- Tag a new version
- Undocumented 'required' struct tag
- String JSON field to int struct field
- Interface types generate associated functions. Maybe they shouldn't.
- (v *RawMessage) UnmarshalJSON(data []byte) does not make copy of data
- Cannot handle uint64 just like std json
- cant gen code in main package HOT 1
- Impact of sanctions on this library
- json.Valid breaks in SkipRecursive
- errors!
- Cli tool type missmatch
- []byte field is incorrectly generated as a string field, making it unmarshalable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyjson.