This commit is contained in:
parent
a35c670c48
commit
5d52558f98
10
TestSuite/question_point1.pas
Normal file
10
TestSuite/question_point1.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
procedure p1<T>(x: T);
|
||||
begin
|
||||
var o := x;
|
||||
var ot := o?.GetType;
|
||||
assert(ot = typeof(integer));
|
||||
end;
|
||||
|
||||
begin
|
||||
p1(2);
|
||||
end.
|
||||
|
|
@ -152,7 +152,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
t = ctn1.compiled_type;
|
||||
if (av.type.type_special_kind == SemanticTree.type_special_kind.array_kind)
|
||||
return;
|
||||
if (!av.type.is_class && !av.type.IsInterface && !(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)))
|
||||
if (!av.type.is_class && !av.type.IsInterface && !(t != null && t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)) && !av.type.is_generic_parameter)
|
||||
AddError(av.location, "OPERATOR_DQ_MUST_BE_USED_WITH_A_REFERENCE_TYPE_VALUETYPE");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue