BHoM / BHoM_Engine

Internal manipulation of the BHoM
GNU Lesser General Public License v3.0
26 stars 13 forks source link

BHoM_Engine: null inputs enabled in TryRunExtensionMethod #3397

Closed pawelbaran closed 3 weeks ago

pawelbaran commented 3 weeks ago

Issues addressed by this PR

Closes #3393

Test files

On SharePoint.

To run the script, add the following snippet into any engine project that has required dependencies:

// Pass ICurve as 1st argument
// Should bind if 2nd argument != null
// Should not bind if 2nd argument == null
public static void AmbiguityTest1(this ICurve curve, Point point)
{

}

// Pass ICurve as 1st argument
// Should bind if 2nd argument != null
// Should not bind if 2nd argument == null
public static void AmbiguityTest1(this ICurve curve, Vector vector)
{

}

// Pass ICurve as 1st argument
// Should always bind
public static void AmbiguityTest1(this ICurve curve)
{

}

// Pass Wall as 1st argument
// Should bind if 2nd argument != null
// Should not bind if 2nd argument == null
public static void AmbiguityTest2(this BH.oM.Physical.Elements.ISurface obj, Point point)
{

}

// Pass Wall as 1st argument
// Should bind if 2nd argument != null
// Should not bind if 2nd argument == null
public static void AmbiguityTest2(this BHoMObject obj, Vector vector)
{

}

// Pass any BHoMObject as 1st argument
// Should always bind
public static void AmbiguityTest3(this BHoMObject obj, Vector vector = null)
{

}

// Pass any BHoMObject as 1st argument
// This one should not bind at any case
public static void AmbiguityTest3(this BHoMObject obj)
{

}

Changelog

Additional comments

IsNullable consists of 2 steps:

pawelbaran commented 3 weeks ago

@BHoMBot check compliance

bhombot-ci[bot] commented 3 weeks ago
@pawelbaran to confirm, the following actions are now queued: - check `code-compliance` - check `documentation-compliance` - check `project-compliance` - check `branch-compliance` - check `dataset-compliance` - check `copyright-compliance` There are 14 requests in the queue ahead of you.
pawelbaran commented 3 weeks ago

@IsakNaslundBh I pushed the commits that we discussed offline, the PR should be ready for review. Please note I added the snippet to paste into Engine before running the test script.

pawelbaran commented 3 weeks ago

@BHoMBot check compliance @BHoMBot check versioning

bhombot-ci[bot] commented 3 weeks ago
@pawelbaran to confirm, the following actions are now queued: - check `code-compliance` - check `documentation-compliance` - check `project-compliance` - check `branch-compliance` - check `dataset-compliance` - check `copyright-compliance` - check `versioning` There are 13 requests in the queue ahead of you.
pawelbaran commented 3 weeks ago

@IsakNaslundBh I removed the newly added errors as discussed, to avoid peppering the existing scripts with surprisingly red components. Also ran quite a few tests from our test library to confirm no new issues got introduced by this PR.

pawelbaran commented 3 weeks ago

@BHoMBot check compliance @BHoMBot check unit-tests @BHoMBot check versioning

bhombot-ci[bot] commented 3 weeks ago
@pawelbaran to confirm, the following actions are now queued: - check `code-compliance` - check `documentation-compliance` - check `project-compliance` - check `branch-compliance` - check `dataset-compliance` - check `copyright-compliance` - check `unit-tests` - check `versioning` There are 14 requests in the queue ahead of you.
IsakNaslundBh commented 3 weeks ago

@BHoMBot check compliance @BHoMBot check required

bhombot-ci[bot] commented 3 weeks ago
@IsakNaslundBh to confirm, the following actions are now queued: - check `code-compliance` - check `documentation-compliance` - check `project-compliance` - check `branch-compliance` - check `dataset-compliance` - check `copyright-compliance` - check `code-compliance` - check `documentation-compliance` - check `project-compliance` - check `core` - check `null-handling` - check `serialisation` - check `versioning` - check `installer` There are 31 requests in the queue ahead of you.
bhombot-ci[bot] commented 3 weeks ago
The check `code-compliance` has already been run previously and recorded as a successful check. This check has not been run again at this time.
bhombot-ci[bot] commented 3 weeks ago
The check `documentation-compliance` has already been run previously and recorded as a successful check. This check has not been run again at this time.
IsakNaslundBh commented 3 weeks ago

@BHoMBot check unit-tests

bhombot-ci[bot] commented 3 weeks ago
@IsakNaslundBh to confirm, the following actions are now queued: - check `unit-tests` There are 13 requests in the queue ahead of you.
IsakNaslundBh commented 3 weeks ago

@BHoMBot check installer

bhombot-ci[bot] commented 3 weeks ago
@IsakNaslundBh to confirm, the following actions are now queued: - check `installer` There are 2 requests in the queue ahead of you.
IsakNaslundBh commented 3 weeks ago

@BHoMBot check ready-to-merge

bhombot-ci[bot] commented 3 weeks ago
@IsakNaslundBh to confirm, the following actions are now queued: - check `ready-to-merge` There are 2 requests in the queue ahead of you.