Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Error (Bad): Unable to find interface for protocol Swift.[Comparable|Equatable] (CompilerException) #151

Open
spouliot opened this issue Apr 12, 2018 · 2 comments
Assignees
Milestone

Comments

@spouliot
Copy link

Source: [email protected]:zenangst/Versions.git

Makefile

SWIFTOMATIC=/Users/poupou/Downloads/swift-o-matic-0

SWIFT_BIN = $(SWIFTOMATIC)/bin/swift/bin
SWIFT_LIB = $(SWIFTOMATIC)/bin/swift/lib/swift/macosx/

SWIFTC = $(SWIFT_BIN)/swiftc
SWIFTARGS = -sdk `xcrun --show-sdk-path` -emit-module -emit-library

TOM_SWIFTY=$(SWIFTOMATIC)/lib/swift-o-matic/tom-swifty.exe
SWIFT_GLUE = $(SWIFTOMATIC)/lib/mac/XamGlue.framework

OUTPUT_MODULE=XamVersions
TOM_SWIFTY_OUTPUT=tsout

all:
	@rm -rf $(TOM_SWIFTY_OUTPUT)
	@mkdir $(TOM_SWIFTY_OUTPUT)
	mono --debug $(TOM_SWIFTY) --retain-swift-wrappers --swift-bin-path $(SWIFT_BIN) -o $(TOM_SWIFTY_OUTPUT) -C . $(OUTPUT_MODULE)

libXamVersions.dylib:
	$(SWIFTC) $(SWIFTARGS) -module-name $(OUTPUT_MODULE) Versions/*.swift

clean:
	@rm -rf tsout
	@rm -rf libXamVersions.dylib

With 2018-04-11 update I get

mono --debug /Users/poupou/Downloads/swift-o-matic-0/lib/swift-o-matic/tom-swifty.exe --retain-swift-wrappers --swift-bin-path /Users/poupou/Downloads/swift-o-matic-0/bin/swift/bin -o tsout -C . XamVersions
Warning: entry __T0SS11XamVersionsE11majorChangeSbSSF uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE11minorChangeSbSSF uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE11patchChangeSbSSF uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE15semanticCompareAA8SemanticOSSF uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE5majorSSfg uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE5minorSSfg uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE5patchSSfg uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE9newerThanSbSSF uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE9olderThanSbSSF uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE9subscriptSSSicfg uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE9subscriptSSs5RangeVySiGcfg uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0SS11XamVersionsE9subscripts9CharacterVSicfg uses an unsupported swift feature, skipping. (NotSupportedException)
Error (Bad): Unable to find interface for protocol Swift.Comparable (CompilerException)
Error (Bad): Unable to find interface for protocol Swift.Equatable (CompilerException)
Warning: Unable to find constructor function declaration for struct XamVersions.Version from method __T011XamVersions7VersionVACSgSScfC (CompilerException)

note: I also have this error (once) in CommandCougar

@spouliot
Copy link
Author

My fork: https://github.com/spouliot/Versions

  1. Edit Makefile, it should only need to change were SoM is located
  2. Enable Equatable and Comparable
diff --git a/Versions/StaticVersion.swift b/Versions/StaticVersion.swift
index 82c19e3..c80ab37 100644
--- a/Versions/StaticVersion.swift
+++ b/Versions/StaticVersion.swift
@@ -10,7 +10,7 @@ extension Array {
   }
 }
 
-public struct Version { //}: Equatable, Comparable {
+public struct Version : Equatable, Comparable {
 
   public let major  : Int
   public let minor  : Int
  1. Run make
$ make
/Users/poupou/Downloads/swift-o-matic/bin/swift/bin/swiftc -sdk `xcrun --show-sdk-path` -emit-module -emit-library -module-name XamVersions Versions/*.swift
Versions/StaticVersion.swift:23:40: warning: 'characters' is deprecated: Please use String or Substring directly
    let parts: Array<String> = version.characters.split { $0 == "." }.map { String($0) }
                                       ^
Versions/Versions.swift:24:22: warning: 'characters' is deprecated: Please use String or Substring directly
    return self[self.characters.index(self.startIndex, offsetBy: i)]
                     ^
Versions/Versions.swift:34:12: warning: 'substring(with:)' is deprecated: Please use String slicing subscript.
    return substring(with: characters.index(startIndex, offsetBy: r.lowerBound)..<characters.index(startIndex, offsetBy: r.upperBound))
           ^
Versions/Versions.swift:34:28: warning: 'characters' is deprecated: Please use String or Substring directly
    return substring(with: characters.index(startIndex, offsetBy: r.lowerBound)..<characters.index(startIndex, offsetBy: r.upperBound))
                           ^
Versions/Versions.swift:34:83: warning: 'characters' is deprecated: Please use String or Substring directly
    return substring(with: characters.index(startIndex, offsetBy: r.lowerBound)..<characters.index(startIndex, offsetBy: r.upperBound))
                                                                                  ^
mono --debug /Users/poupou/Downloads/swift-o-matic/lib/swift-o-matic/tom-swifty.exe --retain-swift-wrappers --swift-bin-path /Users/poupou/Downloads/swift-o-matic/bin/swift/bin -o tsout -C . -module-name XamVersions

Warnings and errors

Error (Fatal): Swift name 'Element' needs to have a module. (TypeMapException)
Error (Fatal): Unable to find C# reference for swift class 'Swift.Character'. (TypeMapException)
csc -nostdlib -noconfig -r:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac//mscorlib.dll -r:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac//System.dll -r:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/reference/mobile/Xamarin.Mac.dll -unsafe -lib:/Users/poupou/Downloads/swift-o-matic/lib/SwiftInterop/ -r:SwiftRuntimeLibrary.Mac.dll -lib:. tsout/*.cs -t:library -out:XamVersions.dll
Microsoft (R) Visual C# Compiler version 2.7.0.62620 (e873e693)
Copyright (C) Microsoft Corporation. All rights reserved.

tsout/VersionXamVersions.cs(15,59): error CS0535: 'Version' does not implement interface member 'ISwiftComparable.OpLess(ISwiftComparable)'
tsout/VersionXamVersions.cs(15,42): error CS0535: 'Version' does not implement interface member 'ISwiftEquatable.OpEquals(ISwiftEquatable)'
make: *** [all] Error 1

@stephen-hawley
Copy link
Contributor

The Element error is due to it being an associated type.
The Character error is not in the SwiftRuntimeLibrary. Yet.

@stephen-hawley stephen-hawley transferred this issue from another repository Oct 29, 2019
@chamons chamons added this to the Future milestone Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants