File tree 2 files changed +52
-0
lines changed
src/tests/JIT/Regression/JitBlue/Runtime_94467 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+ using System ;
5
+ using Xunit ;
6
+
7
+ public static class Runtime_94467
8
+ {
9
+ public interface ITypeChecker
10
+ {
11
+ static abstract bool Test < T > ( T value ) ;
12
+ }
13
+
14
+ public interface IHandler
15
+ {
16
+ bool Test < T > ( T value ) ;
17
+ }
18
+
19
+ public struct TypeChecker : ITypeChecker
20
+ {
21
+ public static bool Test < T > ( T value ) => true ;
22
+ }
23
+
24
+ public class Handler < TChecker > : IHandler where TChecker : ITypeChecker
25
+ {
26
+ public bool Test < T > ( T value ) => TChecker . Test ( value ) ;
27
+ }
28
+
29
+ public static IHandler GetHandler ( ) => new Handler < TypeChecker > ( ) ;
30
+
31
+ [ Fact ]
32
+ public static int Test ( )
33
+ {
34
+ try {
35
+ var handler = GetHandler ( ) ;
36
+ if ( handler . Test < bool > ( true ) && handler . Test < bool ? > ( true ) )
37
+ return 100 ;
38
+ else
39
+ return 101 ;
40
+ } catch ( Exception ) {
41
+ return - 1 ;
42
+ }
43
+ }
44
+ }
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+ <PropertyGroup >
3
+ <Optimize >True</Optimize >
4
+ </PropertyGroup >
5
+ <ItemGroup >
6
+ <Compile Include =" $(MSBuildProjectName).cs" />
7
+ </ItemGroup >
8
+ </Project >
You can’t perform that action at this time.
0 commit comments