[jextract] add support for throwing functions in JNI mode#277
Conversation
| } catch { | ||
| environment.throwAsException(error) | ||
| return Int64.jniPlaceholderValue | ||
| } |
|
|
||
| enum SwiftEffectSpecifier: Equatable { | ||
| case `throws` | ||
| } |
There was a problem hiding this comment.
I think that's okey, in swift-syntax they're just as a keyword afair -- any opinion about such enum @rintaro ?
There was a problem hiding this comment.
The enum look okay to me for now. We should support typed throw some day, but not now.
ktoso
left a comment
There was a problem hiding this comment.
Looks ok to me, one question Rintaro may want to chime in about our new "effect" enum here. I think it's okey though, since we just have the few limited effects we're handling, well, just the one for now, but in future maybe async
|
Looks nice! When you enable previously-unsupported thing in |
| } | ||
| case .accessors(let accessors): | ||
| if let getter = accessors.first(where: { $0.accessorSpecifier.tokenKind == .keyword(.set) }) { | ||
| effectSpecifiers = Self.effectSpecifiers(from: getter) |
There was a problem hiding this comment.
We should do this only if isSet is false.
| switch binding.accessorBlock?.accessors { | ||
| case .getter(let getter): | ||
| if let getter = getter.as(AccessorDeclSyntax.self) { | ||
| effectSpecifiers = Self.effectSpecifiers(from: getter) |
There was a problem hiding this comment.
AccessorBlockSyntax.Accessors.getter can only contain CodeBlockItemListSyntax so this should be unreachable.
|
Disabling |
Adds support for generating throwing functions in JNI mode