Closed CartBlanche closed 4 years ago
@chkn This "Fixes" the shared project crash, by using a namespace from one of the existing exes. Using a unique share-library namespace breaks things. Any ideas or is this a sufficient workaround for now?
Wow good catch! It looks like it crashes if the length of the namespace is even, but not if it's odd. Which is odd :p
It seems we're doing something wrong when constructing the module metadata with the namespace name here: https://github.com/chkn/Xamarin.SwiftUI/blob/master/src/SwiftUI/Swift/Interop/ManagedSwiftType.cs#L274
@chkn could it be the Regex.Replace
call failing us here: https://github.com/chkn/Xamarin.SwiftUI/blob/master/src/SwiftUI/Swift/Interop/ManagedSwiftType.cs#L265
I'll try to have a look during the week.
I think it's more likely that the expected format of the string is some 2 byte encoding like UTF-16
Never mind- I forgot that the tests verify names of types, so we are properly decoding them from the metadata already.
@chkn Been a tad busy, so not looked at this yet. Hoping to do so this weekend. Have a good long weekend!
@chkn I've changed the length of the namespace to an odd length, as a temporary hacky work around for this PR. I'll now try to track down why it the even length namespace causes the crash.
@chkn So it isn't just a namespace issue. Even named Classes also crash :/
Definitely sounds like something weird is going on. I’ll dust off my Swift source check out and try to catch the crash in the debugger
causing the crash. Still very odd, but it builds and runs on both iOS and Mac now.
Changed to an odd numbered name length, as a temporary workaround.
Fixes - https://github.com/chkn/Xamarin.SwiftUI/issues/4