File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change
1
+ // CS0126: An object of a type convertible to `int' is required for the return statement
2
+ // Line: 15
3
+
4
+ using System . Threading . Tasks ;
5
+
6
+ class MainClass
7
+ {
8
+ public static void Main ( )
9
+ {
10
+ Task < C > v = null ;
11
+
12
+ Task . Run ( async ( ) => {
13
+ await Task . Yield ( ) ;
14
+ if ( v == null ) {
15
+ return ;
16
+ }
17
+
18
+ return 1 ;
19
+ } ) ;
20
+ }
21
+ }
22
+
23
+ public class C
24
+ {
25
+ string Id { get ; set ; }
26
+ }
Original file line number Diff line number Diff line change @@ -1135,7 +1135,7 @@ protected override bool DoResolve (BlockContext ec)
1135
1135
var block_return_type = ec . ReturnType ;
1136
1136
1137
1137
if ( expr == null ) {
1138
- if ( block_return_type . Kind == MemberKind . Void )
1138
+ if ( block_return_type . Kind == MemberKind . Void || block_return_type == InternalType . ErrorType )
1139
1139
return true ;
1140
1140
1141
1141
//
You can’t perform that action at this time.
0 commit comments