Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't do null checks on non-nullable types. #21

Open
ikeough opened this issue Dec 14, 2017 · 1 comment
Open

Don't do null checks on non-nullable types. #21

ikeough opened this issue Dec 14, 2017 · 1 comment

Comments

@ikeough
Copy link
Collaborator

ikeough commented Dec 14, 2017

Current exceptions during compile:

IFC.g.cs(8914,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcKnotType' is never equal to 'null' of type 'IfcKnotType?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(8872,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcBSplineCurveForm' is never equal to 'null' of type 'IfcBSplineCurveForm?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(9075,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcKnotType' is never equal to 'null' of type 'IfcKnotType?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(9026,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcBSplineSurfaceForm' is never equal to 'null' of type 'IfcBSplineSurfaceForm?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(9674,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcBooleanOperator' is never equal to 'null' of type 'IfcBooleanOperator?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(10126,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcTrimmingPreference' is never equal to 'null' of type 'IfcTrimmingPreference?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(14840,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcTransitionCode' is never equal to 'null' of type 'IfcTransitionCode?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(27138,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcTextPath' is never equal to 'null' of type 'IfcTextPath?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(29702,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcSIPrefix' is never equal to 'null' of type 'IfcSIPrefix?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(29703,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcSIUnitName' is never equal to 'null' of type 'IfcSIUnitName?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]
IFC.g.cs(32182,19): warning CS0472: The result of the expression is always 'true' since a value of type 'IfcSurfaceSide' is never equal to 'null' of type 'IfcSurfaceSide?' [/Users/ikeough/Documents/IFC-gen/lang/csharp/src/IFC-dotnet.csproj]

These exceptions are because in GetStepParameters() we are doing null checks on non-nullable types. We should redesign how this gathering of STEP parameters works so as not to do a null check on non-nullable types.

@ikeough
Copy link
Collaborator Author

ikeough commented Dec 14, 2017

FYI @simonmoreau.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant