Skip to content

Commit

Permalink
Followed convention of "(object)t != null" for types
Browse files Browse the repository at this point in the history
  • Loading branch information
ljw1004 committed Aug 31, 2016
1 parent eef0c70 commit 0e30e90
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ internal static bool TryCreate(SyntheticBoundNodeFactory F, MethodSymbol method,
if (customBuilder)
{
builderType = ValidateBuilderType(F, builderArgument, returnType.DeclaredAccessibility, desiredArity:0);
if (builderType != null)
if ((object)builderType != null)
{
taskProperty = GetCustomTaskProperty(F, builderType);
createBuilderMethod = GetCustomCreateMethod(F, builderType);
Expand All @@ -168,7 +168,8 @@ internal static bool TryCreate(SyntheticBoundNodeFactory F, MethodSymbol method,
customBuilder,
out taskProperty);
}
if ((object)createBuilderMethod == null ||
if ((object)builderType == null ||
(object)createBuilderMethod == null ||
(object)taskProperty == null)
{
collection = default(AsyncMethodBuilderMemberCollection);
Expand Down Expand Up @@ -209,16 +210,10 @@ internal static bool TryCreate(SyntheticBoundNodeFactory F, MethodSymbol method,

object builderArgument;
bool customBuilder = returnType.IsCustomTaskType(out builderArgument);
if (!customBuilder)
{
builderType = F.WellKnownType(WellKnownType.System_Runtime_CompilerServices_AsyncTaskMethodBuilder_T);
Debug.Assert((object)builderType != null);
builderType = builderType.Construct(resultType);
}
if (customBuilder)
{
builderType = ValidateBuilderType(F, builderArgument, returnType.DeclaredAccessibility, 1);
if (builderType != null)
if ((object)builderType != null)
{
builderType = builderType.ConstructedFrom.Construct(resultType);
taskProperty = GetCustomTaskProperty(F, builderType);
Expand All @@ -227,6 +222,9 @@ internal static bool TryCreate(SyntheticBoundNodeFactory F, MethodSymbol method,
}
else
{
builderType = F.WellKnownType(WellKnownType.System_Runtime_CompilerServices_AsyncTaskMethodBuilder_T);
Debug.Assert((object)builderType != null);
builderType = builderType.Construct(resultType);
TryGetBuilderMember<MethodSymbol>(
F,
WellKnownMember.System_Runtime_CompilerServices_AsyncTaskMethodBuilder_T__Create,
Expand All @@ -240,7 +238,8 @@ internal static bool TryCreate(SyntheticBoundNodeFactory F, MethodSymbol method,
customBuilder,
out taskProperty);
}
if ((object)taskProperty == null ||
if ((object)builderType == null ||
(object)taskProperty == null ||
(object)createBuilderMethod == null)
{
collection = default(AsyncMethodBuilderMemberCollection);
Expand Down

0 comments on commit 0e30e90

Please sign in to comment.