File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
- // FIXME: Function types don't work yet as generic parameters
14
- public struct _REPLExitHandler {
15
- var f : ( ) -> ( )
13
+ internal var _replExitHandlers : [ ( ) -> Void ] = [ ]
16
14
17
- init ( _ f: ( ) -> ( ) ) {
18
- self . f = f
19
- }
20
- }
21
-
22
- var _replExitHandlers = [ _REPLExitHandler] ( )
23
-
24
- public func _atREPLExit( handler: ( ) -> ( ) ) {
25
- _replExitHandlers. append ( _REPLExitHandler ( handler) )
15
+ public func _atREPLExit( handler: ( ) -> Void ) {
16
+ _replExitHandlers. append ( handler)
26
17
}
27
18
28
19
internal func _replExit( ) {
29
- let reversed = _replExitHandlers. reverse ( )
30
- for handler in reversed {
31
- handler. f ( )
20
+ for handler in _replExitHandlers. reverse ( ) {
21
+ handler ( )
32
22
}
33
23
}
34
24
You can’t perform that action at this time.
0 commit comments