Skip to content

Commit

Permalink
Add a missing global:: qualifier in the BindableMetadataGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Feb 20, 2019
1 parent 879beb1 commit a57c42e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/ReleaseNotes/_ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
* #376 iOS project compilation fails: Can't resolve the reference 'System.Void Windows.UI.Xaml.Documents.BlockCollection::Add(Windows.UI.Xaml.Documents.Block)
* 138099, 138463 [Android] fixed `ListView` scrolls up when tapping an item at the bottom of screen
* 140548 [iOS] fixed `CommandBar` not rendering until reloaded
* [147530] Add a missing `global::` qualifier in the `BindableMetadataGenerator`

## Release 1.41

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ where field.IsStatic
using (writer.BlockInvariant("internal static global::Uno.UI.DataBinding.IBindableType Build(global::Uno.UI.DataBinding.BindableType parent)"))
{
writer.AppendLineInvariant(
@"var bindableType = parent ?? new global::Uno.UI.DataBinding.BindableType({0}, typeof(global::{1}));",
@"var bindableType = parent ?? new global::Uno.UI.DataBinding.BindableType({0}, typeof({1}));",
flattenedProperties
.Where(p => !IsStringIndexer(p) && HasPublicGetter(p))
.Count()
Expand All @@ -370,7 +370,7 @@ where field.IsStatic
{
var baseTypeMapped = _typeMap.UnoGetValueOrDefault(baseType);

writer.AppendLineInvariant(@"MetadataBuilder_{0:000}.Build(bindableType); // {1}", baseTypeMapped.Index, baseType.GetFullName());
writer.AppendLineInvariant(@"MetadataBuilder_{0:000}.Build(bindableType); // {1}", baseTypeMapped.Index, ExpandType(baseType));
}

var ctor = ownerType.GetMethods().FirstOrDefault(m => m.MethodKind == MethodKind.Constructor && !m.Parameters.Any() && m.IsLocallyPublic(_currentModule));
Expand Down Expand Up @@ -469,7 +469,7 @@ where field.IsStatic
var getter = $"{XamlConstants.Types.DependencyObjectExtensions}.GetValue(instance, {ownerTypeName}.{propertyName}Property, precedence)";
var setter = $"{XamlConstants.Types.DependencyObjectExtensions}.SetValue(instance, {ownerTypeName}.{propertyName}Property, value, precedence)";

var propertyType = SanitizeTypeName(getMethod.ReturnType.ToString());
var propertyType = GetGlobalQualifier(getMethod.ReturnType) + SanitizeTypeName(getMethod.ReturnType.ToString());

writer.AppendLineInvariant($@"bindableType.AddProperty(""{propertyName}"", typeof({propertyType}), Get{propertyName}, Set{propertyName});");

Expand All @@ -495,7 +495,7 @@ private static string ExpandType(INamedTypeSymbol ownerType)
}
else
{
return ownerType.GetFullName();
return GetGlobalQualifier(ownerType) + ownerType.GetFullName();
}
}

Expand Down

0 comments on commit a57c42e

Please sign in to comment.