Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/scripts/generate_casts.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def mark_cls_compliance(cw, t):
def generate_type_cast(cw, t):
mark_cls_compliance(cw, t)
cw.enter_block("public static %(type)s ExplicitCastTo%(type)s(object o)", type = t)
cw.enter_block("if (o != null)")
cw.enter_block("if (o is not null)")
cw.write("Type type = o.GetType();");

cond = cw.conditions()
Expand Down Expand Up @@ -112,7 +112,7 @@ def generate_type_cast(cw, t):
def generate_nullable_type_cast(cw, t):
mark_cls_compliance(cw, t)
cw.enter_block("public static Nullable<%(type)s> ExplicitCastToNullable%(type)s(object o)", type = t)
cw.enter_block("if (o == null)")
cw.enter_block("if (o is null)")
cw.write("return new Nullable<%(type)s>();", type = t);
cw.exit_block()
cw.write("Type type = o.GetType();");
Expand Down
6 changes: 3 additions & 3 deletions eng/scripts/generate_comdispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def gen_exposed_code_security(cw):
"return null;"
],
setStatements=[
"if (value != null) {",
"if (value is not null) {",
" Marshal.GetNativeVariantForObject(value, UnsafeMethods.ConvertVariantByrefToPtr(ref this));",
"}"
],
Expand All @@ -202,7 +202,7 @@ def gen_exposed_code_security(cw):
"return null;"
],
setStatements=[
"if (value != null) {",
"if (value is not null) {",
" _typeUnion._unionTypes._unknown = Marshal.GetIUnknownForObject(value);",
"}"
],
Expand All @@ -217,7 +217,7 @@ def gen_exposed_code_security(cw):
"return null;"
],
setStatements=[
"if (value != null) {",
"if (value is not null) {",
" _typeUnion._unionTypes._unknown = GetIDispatchForObject(value);",
"}"
],
Expand Down
2 changes: 1 addition & 1 deletion eng/scripts/generate_dynamic_instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def gen_run_method(cw, n, is_void):
types,
','.join(param_names)))

cw.enter_block('if (_compiled != null || TryGetCompiled())')
cw.enter_block('if (_compiled is not null || TryGetCompiled())')
args = ', '.join(['arg%d' % i for i in range(n)])
if is_void:
cw.write('((Action%s)_compiled)(%s);' % (types, args))
Expand Down
4 changes: 2 additions & 2 deletions eng/scripts/generate_reflected_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_func_type_names(i):
return get_type_names(i - 1) + ['TRet']

def get_cast_args(i):
return ['%s != null ? (%s)%s : default(%s)' % (x[0], x[1], x[0], x[1]) for x in zip(get_args(i), get_type_names(i))]
return ['%s is not null ? (%s)%s : default(%s)' % (x[0], x[1], x[0], x[1]) for x in zip(get_args(i), get_type_names(i))]

def get_type_params(i):
if i == 0: return ''
Expand Down Expand Up @@ -84,7 +84,7 @@ def gen_fast_creation(cw):
cw.enter_block('private static CallInstruction FastCreate%s(MethodInfo target, ParameterInfo[] pi)' % get_type_params(i))

cw.write('Type t = TryGetParameterOrReturnType(target, pi, %d);' % (i, ))
cw.enter_block('if (t == null)')
cw.enter_block('if (t is null)')

typeArgs = ', '.join(get_type_names(i))
if i == 0:
Expand Down
2 changes: 1 addition & 1 deletion src/dlr
Submodule dlr updated 257 files