Comments (2)
I'm not sure what you're proposing or asking for here. So you know, this project generates new code to complement the code you've written using partial types. We can't change the code the user already wrote in this model.
from immutableobjectgraph.
I meant if there is any logic in project to work with structs? But evident that it is not relevant here. Sorry.
I doing some weird stuff at runtime dotnet/csharplang#1620 (comment) and
public readonly struct reflect
{
private class taga : Attribute {} [taga]
public readonly long a;
private class tagb : Attribute {} [tagb]
public readonly float b;
private class tagc : Attribute {} [tagc]
public readonly double c;
private class tagd : Attribute {} [tagd]
public readonly decimal d;
private class tage : Attribute {} [tage]
public readonly BigInteger e;
// this will fail on during type init if there is no taga or taga marked wrong type as part of static init
public reflect UpdateA(long zz) => UnsafeToolsTests.Update<reflect, reflect.taga, long>(in this, zz);
}
private static class Change<TType,TTag, TValue>
where TType:unmanaged
where TTag: Attribute
{
public static int offset;
static Change()
{
// VALIDATE that filed tagged by tag is TValue
// Change<TType>.Validate() to validate that TType has all fields tagged.
// TODO: find ofsett of filed onto tag for ZERO COST GENERIC SUTCT ACCESS later
offset = 42;
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static TType Update<TType, TTag, TValue>(in TType v, in TValue t)
where TType:unmanaged
where TTag: Attribute
{
var attr = Change<TType, TTag, TValue>.offset;
var x = new TType();
throw new NotImplementedException("Unsafe.Add v -> Unsafe.Copy t into x from v");
return x;
}
[Fact]
public void Test()
{
reflect rrrr = default;
reflect rrrru = rrrr.UpdateA(123);
from immutableobjectgraph.
Related Issues (20)
- Fix test failures HOT 1
- Emit PureAttribute on all pure members HOT 1
- Analyzer to flag invocations of [Pure] methods as an ExpressionStatementSyntax HOT 2
- Self-referencing collections shouldn't have to have "using IOG;"
- Implement IEqualityComparer<T> for immutable types
- `DefineWithMethodsPerProperty = true` fails when source doc has no using for ImmutableObjectGraph
- Empty/IsEmpty properties HOT 7
- Implement Visitor pattern for Walkers and Re-writers
- Bi-direction relationships a'la Roslyn Red/Green trees HOT 3
- Trying to upgrade from 1.1.7 HOT 7
- Build fails once .NET Core SDK 3 is installed HOT 1
- Missing using ImmutableObjectGraph when model has ImmutableList<T> fields HOT 1
- Can I target .NET FW 4.5 HOT 1
- Property-specific With methods fail when using `ReadOnlyMemory<byte>` fields
- Use <inheritdoc> in many more places to get docs copied
- .Net Core support HOT 1
- Use in .Net Core project HOT 2
- Cannot compile with Visual Studio 2017 HOT 8
- Adding deconstruction
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 immutableobjectgraph.