Comments (7)
cecil should probably switch to TNP for net9-and-above
The new TypeName
API is part of System.Reflection.Metadata
package, which supports older monikers too:
Looks like it's an expected behavior for Type.FullName to return assembly qualified names for generics
Yes, but only for the generic arguments.
> typeof(List<int>).FullName
"System.Collections.Generic.List`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]"
> typeof(List<int>).AssemblyQualifiedName
"System.Collections.Generic.List`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"
from xamlx.
Likely, Cecil one is expected.
Sre is a mix of Type.AssemblyQualifiedName (for generics) and FullName for the main type name itself.
Also, anything that compatible with .NET TypeNameParser is a bonus:
dotnet/runtime#97566
from xamlx.
Looks like it's an expected behavior for Type.FullName to return assembly qualified names for generics. For some reason.
https://learn.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname?view=net-8.0
from xamlx.
For your tests, you might want to use these extensions probably:
XamlX/src/XamlX/TypeSystem/TypeSystem.cs
Lines 341 to 351 in 941dafc
Unless our GetFullName extension is missing generics (which it might do).
from xamlx.
What do you think if I normalized the Sre FullName like in Cecil instead of using an extension method?
from xamlx.
I don't know if it will break anything. It would require double checking any FullName usage.
Also, it's still not clear which variant is more standard.
from xamlx.
Also, it's still not clear which variant is more standard.
there is no spec: dotnet/runtime#97566 (comment)
in the future, more systems are likely to depend on TypeNameParser's behavior. @adamsitnik may able to clarify some confusion. cecil should probably switch to TNP for net9-and-above
from xamlx.
Related Issues (20)
- ArgumentOutOfRange exception in ResolveContentPropertyTransformer.Transform
- IXamlMethod Generic definition HOT 3
- Swap XDocument paraser to Microsoft.Language.Xml
- What the check File.WriteAllBytes("testasm.dll", data) in tests? HOT 7
- Tests/benchmarks failing HOT 10
- XamlParserTests crashes with dotnet test exception for net47 HOT 2
- Cannot compile the project after deleting xaml and code behind files that were compiled before HOT 2
- xamlx error HOT 1
- Support for overriding Content attribute in derived classes HOT 1
- unable to resolve type system.uri error
- TypeConverter not respected on primitive type.
- Emit DynamicDependency for CompiledAvaloniaXaml types to prevent compiled xaml from trimming HOT 4
- Winfx schema version 2009 is failing HOT 3
- `ExpressionParseError` when using `{TemplateBinding .}`
- x:Static with "Path" HOT 2
- Loading xaml on demand to decrease app size after trimming HOT 1
- Svelte and Xaml ❓ HOT 2
- `CecilType.ArrayElementType` returns wrong type for arrays
- [Question] Serializze AST HOT 5
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 xamlx.