Skip to content

Commit d65dd9a

Browse files
committed
Switch readonly closure property warning to error
1 parent 493bf5d commit d65dd9a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -671,17 +671,16 @@ extension IDLType: SwiftRepresentable {
671671
// TODO: handle readonly closure properties
672672
// (should they be a JSFunction? or a closure? or something else?))
673673
if case let .single(name) = value {
674-
let readonlyComment: SwiftSource = readonly ? " /* XXX: should be readonly! */ " : ""
675-
// print(ModuleState.types)
674+
precondition(!readonly, "readonly closure properties are not supported")
676675
if let callback = ModuleState.types[name] as? IDLCallback {
677-
return "\(closureWrapper(callback, optional: false))\(readonlyComment)"
676+
return "\(closureWrapper(callback, optional: false))"
678677
}
679678
if let ref = ModuleState.types[name] as? IDLTypedef,
680679
case let .single(name) = ref.idlType.value,
681680
let callback = ModuleState.types[name] as? IDLCallback
682681
{
683682
assert(ref.idlType.nullable)
684-
return "\(closureWrapper(callback, optional: true))\(readonlyComment)"
683+
return "\(closureWrapper(callback, optional: true))"
685684
}
686685
}
687686

0 commit comments

Comments
 (0)