xamarin / binding-tools-for-swift

MIT License
160 stars 21 forks source link

[CommandCougar] Several warnings and errors #147

Open spouliot opened 6 years ago

spouliot commented 6 years ago
Error (Bad): Function XamCougar.xam_proxy_FlagIndexable.get_flag has an unknown return type XamCougar.Option.Flag (NotImplementedException)
Error (Bad): Skipping C# wrapping protocol XamCougar.FlagIndexable, due to a previous error. (CompilerException)

and

Error (Bad): In XamCougar.Command..ctor, closure type XamCougar.CommandEvaluation throws -> () throws, which is not supported yet. (CompilerException)
Error (Bad): Skipping C# wrapping struct XamCougar.Command, due to a previous error. (CompilerException)

leads to generated code that cannot be compiled

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:"/Users/poupou/Dropbox (Personal)/Xamarin.Mac.dll" -unsafe -lib:/Users/poupou/Downloads/swift-o-matic/lib/SwiftInterop/ -r:SwiftRuntimeLibrary.Mac.dll -lib:. tsout/*.cs -t:library -out:XamCougar.dll
Microsoft (R) Visual C# Compiler version 2.6.0.62309 (d3f6b8e7)
Copyright (C) Microsoft Corporation. All rights reserved.

tsout/OptionEvaluationXamCougar.cs(13,51): error CS0246: The type or namespace name 'IFlagIndexable' could not be found (are you missing a using directive or an assembly reference?)
tsout/OptionEvaluationXamCougar.cs(14,9): error CS0246: The type or namespace name 'ICustomStringConvertible' could not be found (are you missing a using directive or an assembly reference?)
tsout/OptionEvaluationXamCougar.cs(11,37): error CS0246: The type or namespace name 'IFlagIndexable' could not be found (are you missing a using directive or an assembly reference?)
tsout/OptionXamCougar.cs(13,41): error CS0246: The type or namespace name 'IFlagIndexable' could not be found (are you missing a using directive or an assembly reference?)
tsout/OptionXamCougar.cs(13,57): error CS0246: The type or namespace name 'ICustomStringConvertible' could not be found (are you missing a using directive or an assembly reference?)
tsout/OptionXamCougar.cs(11,37): error CS0246: The type or namespace name 'IFlagIndexable' could not be found (are you missing a using directive or an assembly reference?)
tsout/CommandEvaluationXamCougar.cs(295,10): error CS0246: The type or namespace name 'Command' could not be found (are you missing a using directive or an assembly reference?)
tsout/CommandEvaluationXamCougar.cs(314,30): error CS0246: The type or namespace name 'Command' could not be found (are you missing a using directive or an assembly reference?)
tsout/CommandEvaluationXamCougar.cs(413,16): error CS0246: The type or namespace name 'Command' could not be found (are you missing a using directive or an assembly reference?)
tsout/CommandEvaluationXamCougar.cs(15,35): error CS0246: The type or namespace name 'Command' could not be found (are you missing a using directive or an assembly reference?)
make: *** [all] Error 1
VincentDondain commented 6 years ago

@spouliot how can I reproduce this? Can you link XamCougar.dll?

Also do we expect a fatal crash given the unimplemented features?

spouliot commented 6 years ago
  1. Checkout my fork, swift3 branch (since latest code needs Xcode 9.4)
  2. run make
$ make
/Users/poupou/Downloads/swift-o-matic/bin/swift/bin/swiftc -sdk `xcrun --show-sdk-path` -emit-module -emit-library -module-name XamCougar Sources/*.swift
Sources/OptionEvaluation.swift:52:18: warning: 'characters' is deprecated: Please use String or Substring directly
                switch (string.characters.first?.asString, string.characters.second?.asString) {
                               ^
Sources/OptionEvaluation.swift:52:53: warning: 'characters' is deprecated: Please use String or Substring directly
                switch (string.characters.first?.asString, string.characters.second?.asString) {
                                                                  ^
Sources/OptionEvaluation.swift:57:23: warning: 'characters' is deprecated: Please use String or Substring directly
                        let split = string.characters.dropFirst(2).asString.components(separatedBy: "=")
                                           ^
Sources/OptionEvaluation.swift:71:23: warning: 'characters' is deprecated: Please use String or Substring directly
                        let split = string.characters.dropFirst().asString.components(separatedBy: "=")
                                           ^
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 XamCougar

Warnings and errors

Warning: entry __T0Sa9XamCougarAA13FlagIndexableRzlE9subscriptxSgAA6OptionV0C0Ocfm uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0Sa9XamCougarAA13FlagIndexableRzlE9subscriptxSgSScfm uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: entry __T0Sa9XamCougarAA16CommandIndexableRzlE9subscriptxSgSScfm uses an unsupported swift feature, skipping. (NotSupportedException)
Warning: XamCougar.CommandEvaluation.retrieveParameter is deprecated, skipping. (CompilerException)
Warning: Unable to wrap operator == in struct XamCougar.Option.==: operators not supported yet, skipping (CompilerException)
Error (Bad): In XamCougar.Command..ctor, closure type XamCougar.CommandEvaluation throws -> () throws, which is not supported yet. (CompilerException)
Warning: Unable to wrap operator == in struct XamCougar.Parameter.==: operators not supported yet, skipping (CompilerException)
Error (Bad): Function XamCougar.xam_proxy_FlagIndexable.get_flag has an unknown return type XamCougar.Option.Flag (NotImplementedException)
Error (Bad): Unable to find type declaration for type extension on Swift.Sequence (CompilerException)
Error (Bad): Unable to find type declaration for type extension on Swift.Collection (CompilerException)
Error (Bad): Unable to find type declaration for type extension on Swift.Character (CompilerException)
Error (Fatal): XamCougar-Array-Extension4.swift:5:84: error: use of undeclared type 'Element'
public func xamarin_SwifEArrayGsubscript<T0>(retval: UnsafeMutablePointer<Optional<Element>>, 
                                                                                   ^~~~~~~
XamCougar-Array-Extension4.swift:12:38: error: use of undeclared type 'Element'
    newValue: UnsafePointer<Optional<Element>>, commandName: 
                                     ^~~~~~~
 (Exception)
Error (Fatal): Failed to wrap module XamCougar. (CompilerException)
stephen-hawley commented 6 years ago

Note to future steve - looks like an associated type.