Skip to content

Integrate upstream PR #130: Fix extension method bugs#2

Open
mistial-dev wants to merge 3 commits into
developfrom
pr-130
Open

Integrate upstream PR #130: Fix extension method bugs#2
mistial-dev wants to merge 3 commits into
developfrom
pr-130

Conversation

@mistial-dev

Copy link
Copy Markdown
Owner

This PR integrates the fixes from upstream PR moonsharp-devs#130 by @havietisov.

Fixes

  1. Multiple extension methods on same userdata - Removed the version check that prevented calling multiple extension methods on the same userdata instance
  2. Generic extension methods exception - Added check to prevent calling GetGenericTypeDefinition() on generic parameters

Changes

  • Removed version check in DispatchingUserDataDescriptor.cs that was preventing multiple extension method calls
  • Added \!extensionType.IsGenericParameter check in ExtensionMethodsRegistry.cs to fix exceptions with generic extension methods

Original PR has been open since 2016 and addresses legitimate bugs that affect Unity developers using libraries like DOTween.

Rygor Borodoolin and others added 3 commits March 8, 2016 11:40
…called extension method in each userdata instance

example :
userdata.ExtMethod1() --called fine
userdata.ExtMethod2() --null indexer!
… case when multiple extension methods with similar signature were available in different extension classes, and one of the extension methods has generic argument as extendable type:

TweenSettingsExtensions.SetEase<T>(this T t, Ease ease) where T : Tween; //this one cause exception shot upon calling SetEase
SpecialTweenExtensions.SetEase(this Tweener @this, Ease ease)
Generic extension exception and multiple extension methos for single userdata: fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant