diff options
author | Daniel Grunwald <daniel@danielgrunwald.de> | 2010-10-09 23:30:05 +0400 |
---|---|---|
committer | Daniel Grunwald <daniel@danielgrunwald.de> | 2010-10-09 23:30:05 +0400 |
commit | b46cfa7e299077f69fb1118dfb997b0c7f99d3fa (patch) | |
tree | 69acd0fdfa995eb37cc0380b1d09af4d0d1b1c58 /README | |
parent | 8792c243cbec2fcbd8c0dd074e43a14a026ce0c9 (diff) |
Added CastTests.
Constant folding: fixed implicit conversions and casts to use C# semantics
Diffstat (limited to 'README')
-rw-r--r-- | README | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -8,3 +8,21 @@ ICSharpCode.NRefactory.TypeSystem.Implementation: ICSharpCode.NRefactory.CSharp.Dom: Abstract Syntax Tree for C# + +ICSharpCode.NRefactory.CSharp.Resolver: + Semantic analysis for C# + +Null-Object pattern: + The NRefactory library makes extensive use of the null object pattern. + As a reult, NullReferenceExceptions should be very rare when working with this library. + In the type system, both ITypeReference and IType use SharedTypes.UnknownType to represent unknown types. + Unless the method is documented otherwise, no method or property returning a ITypeReference or IType will return null. + When adding to this library, to try to keep such uses of null rare. + + Note that the null object pattern is not used for ITypeDefinition: + IProjectContent.GetClass() returns null when a type is not found. Take care to abort your operation or substitute UnknownType + instead of passing the null to code expecting an IType. + + The pattern also extends to the C# resolver, which always produces a ResolveResult, even in error cases. + Use ResolveResult.IsError to detect resolver errors. Also note that many resolver errors still have a meaningful type attached, + this allows code completion to work in the presence of minor semantic errors. |