Have compiler return semantic errors in lambdas even in the presence of syntax errors #1867
Closed
Description
opened on Apr 8, 2015
Today, the compiler does not return semantic errors inside lambdas in the IDE if there are syntax errors. This causes several quick fix scenarios to fail inside lambdas (for example #1239, #1241, and #1744 are all caused by this problem).
Consider the code sample below from issue #1239:
using System.Threading.Tasks;
class C {
C() {
Task.Run(() => {
new C(0)
});
}
}
new C(0) will never be squiggled by the IDE because of the lack of a semicolon. This makes quick-fixes that could generate a constructor unable to run because there is no error to trigger them.
By having the compiler return semantic errors in lambdas even in the presence of syntax errors, many more IDE scenarios will "Just Work"
Activity