Roslyn 中的重大更改列表 [英] List of breaking changes in Roslyn

查看:118
本文介绍了Roslyn 中的重大更改列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

切换到 Visual Studio 2015 后,我们注意到在 Roslyn 中对 lambdas 编译为 MSIL 的方式进行了一些更改(在 thisthreadon GitHub)在某些条件下引入运行时故障.>

由于 Roslyn 显然是 .NET 的未来,我们想切换到这项技术,但似乎所有在生产中运行的遗留代码(并且我们有相当程度的信心可以正常工作)现在容易出现新的运行时故障.这些是也受此问题影响的几个库(例如 Moq,例如).

对于 它的问题,但我相信 Visual Studio 2015 与 Roslyn 高度集成,我认为我们不能简单地手动替换 csc.exe(但那是 另一个问题).

那么,是否有 Roslyn 中的重大更改的汇编列表,我们可以参考以了解我们可以期待什么?

解决方案

(更新)

感谢@NealGafter 提供链接.当前可以在此处找到重大更改列表:

<小时>

似乎这里应该有一些文档:Roslyn Compiler Specification (roslynGitHub 上的/docs/compilers).根据描述:

<块引用>

编译器规范详细说明了 Roslyn VB 和 C# 编译器支持(和半支持)的表面积.这包括

  1. 命令行开关及其含义
  2. 对以前版本的编译器的重大更改
  3. (有意)违反规范的编译器行为
  4. 语言规范中未描述的编译器功能
    • COM 特定和其他 Microsoft 特定功能
    • 影响编译器行为的众所周知"属性
    • 规则集"文件语法和语义
  5. 包括用于 C# 和 VB 之间互操作性的功能,例如
    • 命名索引器在 C# 中使用
  6. 编译器行为与语言规范不同的地方
  7. 限制(例如标识符长度)
  8. 每个版本的语言更改历史

描述有关 lambda 的 CodeGen 更改的文档(因为这是我最初的问题)位于 roslyn/docs/compilers/CSharp/CodeGen 差异:

<块引用>

非提升 Lambda 表达式现在作为单例显示类的实例方法实现.由于委托的入口点是实例Invoke"方法,如果该方法也是具有与Invoke"完全相同的形式签名的实例方法,则在运行时将委托调用分派给底层实现方法会更便宜.

After switching to Visual Studio 2015, we have noticed that some changes made to how lambdas are compiled to MSIL in Roslyn (described in this thread and on GitHub) introduce runtime failures under certain conditions.

Since Roslyn is obviously the future of .NET, we would like to switch to this technology, but it seems that all legacy code which has been running in production (and where we have a fair degree of confidence it works correctly) is now prone to new runtime failures. These are several libraries which are impacted by this issue also (like Moq, for example).

We already skipped the upgrade to RyuJIT for its issues, but I believe Visual Studio 2015 is heavily integrated with Roslyn and I don't think we can simply replace the csc.exe manually (but that's a different question).

So, is there a compiled list of breaking changes in Roslyn which we could reference to see what we can expect?

解决方案

(Update)

Thanks to @NealGafter for providing the link. The list of breaking changes can currently be found here:


It seems that some documentation is supposed to be here: Roslyn Compiler Specification (roslyn/docs/compilers on GitHub). According to the description:

The compiler specification details the supported (and semi-supported) surface area of the Roslyn VB and C# compilers. This includes

  1. Command-line switches and their meaning
  2. Breaking changes from previous versions of the compilers
  3. Compiler behaviors that are (intentionally) contrary to the specification
  4. Compiler features not described by the language specification
    • COM-specific and other Microsoft-specific features
    • "Well-known" attributes that affect compiler behavior
    • The "ruleset" file syntax and semantics
  5. Features included for interoperability between C# and VB, for example
    • Named Indexers use from C#
  6. Places where the compiler behavior diverges from the language specification
  7. Limitations (e.g. identifier length)
  8. History of language changes per version

The document describing changes to CodeGen regarding lambdas (because this was my initial issue) is at roslyn/docs/compilers/CSharp/CodeGen Differences:

Non-lifting Lambda expressions are now implemented as instance methods on singleton display classes. Since the entry point to the delegate is the instance "Invoke" method, it is cheaper at runtime to dispatch delegate invocations to the underlying implementing method if such method is also an instance method with exactly same formal signature as "Invoke".

这篇关于Roslyn 中的重大更改列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆