- 07 1月, 2015 4 次提交
-
-
由 AlekseyTs 提交于
VB CLSComplianceChecker: Visit declaration in each module separately to avoid dealing with merged namespaces. Merged namespaces do not have containing module, which was causing a NullReferenceException. ***NO_CI*** (changeset 1389009)
-
由 TomasMatousek 提交于
-
由 TomasMatousek 提交于
Marks CSharpKind and VBKind extension methods as Obsolete and adds equivalent extension methods Kind for both languages. Marks CSharpKind and VBKind instance methods on language specific syntax nodes Obsolete as well. (changeset 1388816)
-
由 nmgafter 提交于
We also add all of the relevant optimizations requested for current and future formatting performance improvements. We now use full overload resolution (using a new binder type specialized for synthesizing invocations) to select an appropriate string.Format method or format factory method, which enables it to handle params, generics, arbitrary argument conversions, etc, and we optimize the special case of no fill-ins by processing the {{ and }} escapes, producing a literal in the generated code. (changeset 1388224)
-
- 24 12月, 2014 5 次提交
-
-
由 AlekseyTs 提交于
Anonymous Type.ToString() implementation should use overload of String.Format that takes IFormatProvider. Also, C# implementation should explicitly call Object.ToString on each property value before passing it to the Format function, this ensures compatibility with code generated by native compiler. ***NO_CI*** (changeset 1386476)
-
由 pgavlin 提交于
This brings us back on par with Dev12. ***NO_CI*** (changeset 1385660)
-
由 AlekseyTs 提交于
C#: Do not bind constructor initializer for an “external” constructor, report an error if constructor initializer is present in code. This prevents unexpected diagnostics. Fixes #386. ***NO_CI*** (changeset 1384736)
-
由 nmgafter 提交于
-
由 vladres 提交于
-
- 04 12月, 2014 3 次提交
-
-
由 vladres 提交于
-
由 nmgafter 提交于
The existing code to handle cycles while binding base classes is exposed to new situations due to the presence of static import in the language. We extend the mechanism to cut short cycles in those cases as well. (changeset 1379204)
-
由 jaredpar 提交于
This change allows conditional member access as a member declarator of an anonymous object expression. It is now legal to do the following: class C { int L { get { return 0; } } void Test() { C local = null; var x1 = new { local.L }; var x2 = new { local?.L } ; } } The initializer of x1 and x2 will produce a single anonymous type definition. It will have a single field named L. This closes DevDiv 991505 and CodePlex 199 ***NO_CI*** (changeset 1378486)
-
- 22 11月, 2014 1 次提交
-
-
由 angocke 提交于
At least some of the cab files indicate that the compiler is crashing while emitting custom attributes. This appears to be due to the compiler-generated DebuggerDisplayAttribute which is emitted on anonymous types. The current synthesis of the attribute proceeds without checking if a properly formed DebuggerDisplayAttribute type is present in the compilation. This changes the attribute synthesis helpers to check if the well-known members exist before synthesizing the attribute. (changeset 1376039)
-
- 13 11月, 2014 1 次提交
-
-
由 mattwar 提交于
Change delegate.EndInvoke's IAsyncResult parameter name to __result to match previous compiler behavior. (changeset 1370234)
-
- 12 11月, 2014 1 次提交
-
-
由 acasey 提交于
Otherwise, every lookup is ambiguous, since they have the same name (and both are accessible while debugging). Perf impact 1: PEFieldSymbol and PEEventSymbol each gain an additional reference field. Perf impact 2: If a field has the same name as an event on the same type, its type will be evaluated eagerly. Caveat: We're not making a corresponding change for auto-props because the only value would be API consistency. CR: AlekseyT; NGafter; ToMat (changeset 1370165)
-
- 11 11月, 2014 1 次提交
-
-
由 AlekseyTs 提交于
-
- 08 11月, 2014 2 次提交
-
-
由 acasey 提交于
The problem is that the mangled name for an static machine type looks like "<" + methodName + ">d__" + uniqueId. However, methodName will have dots in it for explicit interface implementations (e.g. "<I.F>d__0"). Unfortunately, the native compiler emits such names in a very strange way: everything before the last dot goes in the namespace (!!) field of the typedef. Since state machine types are always nested types and since nested types never have explicit namespaces (since they are in the same namespaces as their containing types), it should be safe to check for a non-empty namespace name on a nested type and prepend the namespace name and a dot to the type name. After that, debugging support falls out. CR: AnGocke; ToMat; AlekseyT (changeset 1368701)
-
由 nmgafter 提交于
-
- 30 10月, 2014 1 次提交
-
-
由 VSadov 提交于
***NO_CI*** (changeset 1363488)
-
- 29 10月, 2014 1 次提交
-
-
由 VSadov 提交于
This way we can have better performance of invocations while keeping parameter list of delegate.Method backwards compatible. The approach is basically always to emit backing methods into a display class, just that in a case of lambdas not capturing anything, the display classes will not have any fields. Also, when display classes do not have any fields, lambdas of all nongeneric methods in a given class can share the same display class and in fact can share the same singleton instance. ***NO_CI*** (changeset 1359290)
-
- 17 10月, 2014 1 次提交
-
-
由 angocke 提交于
***NO_CI*** (changeset 1356181)
-
- 16 10月, 2014 1 次提交
-
-
由 ChuckStoner 提交于
Update assert in TypeUnification.CanUnify for substitutions from type parameter to type parameter (changeset 1354882)
-
- 07 10月, 2014 2 次提交
-
-
由 TomasMatousek 提交于
Previously the user had to pass both of these objects to CompilationOptions and the compiler had to call first the resolver to resolve the path specified in #r: string ResolveReference(string reference, string baseFilePath) and then the provider to create the reference: PortableExecutableReference GetReference(string resolvedPath, MetadataReferenceProperties properties) With this change the compiler simply calls on MetadataReferenceResolver: ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties) Notice that now the resolver may return multiple references. This is needed to support #r of NuGet packages. We used reference resolvers and providers in many ways for multiple purposes. I left behind the metadata file resolvers and providers to avoid making too many changes, but made them internal. In some cases the usage is legitimate, but still an implementation detail. More cleanup will also be possible once we remove the old scripting API. For now I have worked around all these dependencies. (changeset 1349333)
-
由 TomasMatousek 提交于
Moves options that were previously on CompilationOptions but were not used until emit phase to EmitOptions: fileAlignment, baseAddress, highEntropyVirtualAddressSpace, subsystemVersion, runtimeMetadataVersion. They hold on values written to various PE headers. We can now easily add other similar PE flags to EmitOptions, which is a common customer request, without affecting code that works with compilation options in other layers (workspaces, project system, etc.). Removes EmitMeadataOnly method and instead adds a MetadataOnly flag to EmitOptions. Removes MetadataOnlyEmitOptions - they were not used and can now be easily added as bools to EmitOptions. Moves pdbFilePath and outputName from parameters of Emit to EmitOptions. IDE: remove tracking of options that were moved to EmitOptions, since the IDE doesn't care about options that don't affect compilation. (changeset 1348623)
-
- 06 10月, 2014 2 次提交
-
-
由 ADGreen 提交于
Abbreviates the public VB-specific types (e.g. VisualBasicSyntaxTree -> VBSyntaxTree) in accordance with the .NET Class Library Guidelines to avoid overly lengthy names and consistent with the conventions used in other APIs (e.g. VB CodeDom). (changeset 1348499)
-
由 TomasMatousek 提交于
-
- 04 10月, 2014 1 次提交
-
-
由 AlekseyTs 提交于
C#: Changing BaseListSyntax to contain a list of BaseTypeSyntax nodes rather than a list of TypeSyntax nodes. (changeset 1347630)
-
- 02 10月, 2014 8 次提交
-
-
由 nmgafter 提交于
-
由 VSadov 提交于
For accesses to an autoprop in a corresponding [static|instance] constructor - (a) It should bind to the property, but the property should be treated as a readable/writable even if it is a readonly autoprop. (b) The definite assignment behavior should be as if directly accessing the backing field. (c) It should code gen to the property accessor (if one exists) or a field access (if not). The most observable outcome of all this is that it is possible to assign a readonly autoprop in the constructor and that in a struct instance constructor you no longer need to initialize whole struct before using any of its autoprops. The following code is now valid and does what you think it does: public struct S { public int X{get;} public int Y{get;} public S() { X = 42; Y = X; } public static void Main() { S s = new S(); System.Console.WriteLine(s.Y); } } . (changeset 1346315)
-
由 angocke 提交于
-
由 TomasMatousek 提交于
This shelveset implements following changes to metadata reference compiler API in order to remove duplication in the public surface and prevent users from unexpected metadata lifetime issues: 1) MetadataImageReference and MetadataFileReference overlap Currently MetadataImageReference can be constructed from a Stream. MetadataImageReference supports metadata prefetch (reading the blob into memory and close the underlying stream) as well deferred reading (no content is read until the reference is consumed during compilation). MetadataFileReference only supports deferred reading. Lifetime of MetadataFileReference is non-deterministic, the underlying file is locked until no references exist and we GC the metadata. On the other hand, it is possible to construct MetadataImageReference in such a way that allows controlling the underlying resources deterministically. Remove MetadataFileReference, use MetadataImageReference instead. 2) Lifetime management AssemblyMetadata and ModuleMetadata objects hold on resources and implement IDisposable. When using MetadataFileReference constructors and some MetadataImageReference constructors to create references the underlying metadata objects are created implicitly and the user doesn’t have a way to explicitly dispose them. Make MetadataImageReference constructors internal and instead add factory method GetReference on AssemblyMetadata/ModuleMetadata. The usage pattern is: using (var metadata = AssemblyMetadata.CreateFromXxx(…)) { var compilation = CSharpCompilation.Create(syntaxTrees, new[] { metadata.GetReference() }); … } In addition the shelveset makes MetadataImageReference internal and adds the following convenience APIs, that are not the most efficient but are very convenient, easy to discover and safe to use for customers that don’t wanna explicitly manage the lifetime of metadata objects. (changeset 1345987)
-
由 vladres 提交于
Fix bug 1032724: Do not give error CS0842: 'C.X': Automatically implemented properties cannot be used inside a type marked with StructLayout(LayoutKind.Explicit) for static auto-properties (changeset 1345941)
-
由 AlekseyTs 提交于
C# SymbolDisplay: Do not qualify properties and events with implemented interface name unless they were already qualified. (changeset 1345691)
-
由 nmgafter 提交于
Similarly for DynamicType and PointerType. (changeset 1345275)
-
由 AlekseyTs 提交于
-
- 27 9月, 2014 1 次提交
-
-
由 mattwar 提交于
(changeset 1343137)
-
- 26 9月, 2014 2 次提交
-
-
由 TomasMatousek 提交于
AssemblyMetadata and ModuleMetadata factories should not read the content of the PE file/metadata blob. Currently the factories read the headers, Assembly and Modules tables, which might result in BadImageFormatException being thrown. This exception is not turned into a compilation diagnostic because it happens before the compilation is created. A user of the Roslyn API thus needs to handle these errors in two places (as an exception and as a diagnostics). The content reading should be deferred until the AssemblyMetadata/ModuleMetadata is queried for content. This change defers metadata/PE headers reading and decoding until the AssemblyMetadata and ModuleMetadata properties/methods are called. For metadata created from files it aims to match the usage pattern of other APIs working with FileStream. The metadata factory opens the file, which might throw IO exception, but doesn't start reading the stream until the compiler asks for it, therefore it doesn't throw BadImageFormatException. The functionality is equivalent to the user opening a FileStream and creating metadata from that stream (except for a slight complication with multi-module assemblies, which are rare). Thus the API for metadata creation are consistent among in-memory byte array, stream, and file path. (changeset 1342462)
-
由 VSadov 提交于
Making instance field and property initializers in structs an error. Making the instance constructors in structs not experimental. (changeset 1342196)
-
- 25 9月, 2014 2 次提交
-
-
由 VSadov 提交于
Fixes subtle potential race condition that could be allowed by the lowering of null-propagating operator. The general rule here is that compiler should not introduce reads to the same location on the heap. Doing so can introduce races to the user's code that otherwise does not have races. As a result of that it is ok to read a local variable multiple times, but only if the local cannot be modified in between reads and when it is known to not be captured into a closure. In particular at lowering stage (before lambda rewritings) without additional analysis we do not know if locals could be captured into closures and therefore shared with other threads and modified between reads. == in this change: Do not assume that reads of locals and byval parameters are idempotent if we do not know whether they may be captured in closures. Without additional analysis we can not make this assumption, so at the time of local rewrite we must conservatively consider locals and parameters as potentially returning different value every time they are evaluated. Note that nullables are excluded from this rule. That is because in the ?. operators over nullable we do not read the same location twice. We read "HasValue" and then conditionaly read ValueOrDefault. That is no different than just reading both values unconditionally - we would not introduce any new races if we do not cache the whole local between such reads. . (changeset 1341599)
-
由 acasey 提交于
Checking in for MattWar. (changeset 1340558)
-