Comments (10)
No worries, if only dotnet's ElementAt would have checked for IReadOnlyList instead of IList :)
But, is it breaking? IReadOnlyList implements IReadOnlyCollection, so all code that works now, should remain working?
It might need recompiling, not 100% sure how the CLI handles that at runtime, is the return type part of the signature?
from json-everything.
Doesn't matter, it still doesn't like it:
Unhandled exception. System.MissingMethodException: Method not found: 'System.Collections.Generic.IReadOnlyCollection`1<Char> MethodSignatureTest.Lib.Extensions.GetContents(System.String)'.
at Program.<Main>$(String[] args)
When i update only the called assembly from:
namespace MethodSignatureTest.Lib
{
public static class Extensions
{
public static IReadOnlyCollection<char> GetContents(this string data)
{
return data.ToCharArray();
}
}
}
to:
namespace MethodSignatureTest.Lib
{
public static class Extensions
{
public static IReadOnlyList<char> GetContents(this string data)
{
return data.ToCharArray();
}
}
}
while living the calling assembly intact:
using MethodSignatureTest.Lib;
var bytes = "hello world".GetContents();
Console.WriteLine("Hello, World:" + bytes.Count);
So yes, the return type is not part of the signature for compilation, but once compiled, it does matter.
from json-everything.
Yeah, I can update those, but it would be a breaking change, so it could be a bit. For now, feel free to just cast them. I'm not doing any transformations from the keywords, so a direct cast will work.
from json-everything.
Return type is part of the signature, but I think you're right. This would be breaking if these methods were on an interface, but not as static methods.
from json-everything.
No, return type is NOT part of the signature. That's why you can't have method overloads that only differ in return type. ;-)
from json-everything.
So yes, the return type is not part of the signature for compilation, but once compiled, it does matter.
Oh dang, you're right.
from json-everything.
@SGStino would you like to submit a PR for these changes?
from json-everything.
Sure, I'll have a look.
Is there any particular reason the enum keyword is build around a collection instead of a list? Shall I take that one with the rest or leave it?
from json-everything.
A collection is more general. There's no reason you should need to access them with an index.
They should also all be read-only.
from json-everything.
Then it should be #707?
from json-everything.
Related Issues (20)
- Support custom keywords in schema generation HOT 6
- Evaluate JsonRequired Attribute HOT 5
- Model with Nullable value type is invalid HOT 1
- Model is not valid when has integer value as string HOT 1
- that the custom metastructure could not be parsed HOT 4
- How to extend SchemaGenerator for DateTime HOT 7
- JsonSchema.NET DataValidation HOT 10
- Custom `IAttributeHandler` never called HOT 5
- Anchors naming of 2020 still following 2019 rules HOT 5
- Generating a Custom JSON Schema HOT 1
- ArgumentOutOfRangeException thrown when calling JsonSchema's Evaluate methods from multiple threads. HOT 3
- 2020-12 output incorrectly places annotations
- Nullable decimal type removes multipleOf HOT 1
- Boolean applicator keywords must be non-empty HOT 1
- Issues with rendering on docs site HOT 1
- Verified error reporting type HOT 18
- 'Required' is an ambiguous reference between 'System.ComponentModel.DataAnnotations.RequiredAttribute' and 'Json.Schema.Generation.RequiredAttribute'? HOT 22
- Schema exception {"An item with the same key has already been added. Key: Child"} HOT 9
- Customizing the `format` generated for a field (without attributes) 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 json-everything.