-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #914 from hylo-lang/coercions
Implement implicit coercions for let and inout bindings
- Loading branch information
Showing
38 changed files
with
872 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// Just like Swift.precondition, but includes the full file path in the diagnostic. | ||
func precondition( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.precondition(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.preconditionFailure, but includes the full file path in the diagnostic. | ||
func preconditionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.preconditionFailure(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.fatalError, but includes the full file path in the diagnostic. | ||
func fatalError( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.fatalError(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assert, but includes the full file path in the diagnostic. | ||
func assert( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assert(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assertionFailure, but includes the full file path in the diagnostic. | ||
func assertionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assertionFailure(message(), file: (file), line: line) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// Just like Swift.precondition, but includes the full file path in the diagnostic. | ||
func precondition( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.precondition(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.preconditionFailure, but includes the full file path in the diagnostic. | ||
func preconditionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.preconditionFailure(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.fatalError, but includes the full file path in the diagnostic. | ||
func fatalError( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.fatalError(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assert, but includes the full file path in the diagnostic. | ||
func assert( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assert(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assertionFailure, but includes the full file path in the diagnostic. | ||
func assertionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assertionFailure(message(), file: (file), line: line) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// Just like Swift.precondition, but includes the full file path in the diagnostic. | ||
func precondition( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.precondition(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.preconditionFailure, but includes the full file path in the diagnostic. | ||
func preconditionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.preconditionFailure(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.fatalError, but includes the full file path in the diagnostic. | ||
func fatalError( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.fatalError(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assert, but includes the full file path in the diagnostic. | ||
func assert( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assert(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assertionFailure, but includes the full file path in the diagnostic. | ||
func assertionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assertionFailure(message(), file: (file), line: line) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// Just like Swift.precondition, but includes the full file path in the diagnostic. | ||
func precondition( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.precondition(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.preconditionFailure, but includes the full file path in the diagnostic. | ||
func preconditionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.preconditionFailure(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.fatalError, but includes the full file path in the diagnostic. | ||
func fatalError( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.fatalError(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assert, but includes the full file path in the diagnostic. | ||
func assert( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assert(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assertionFailure, but includes the full file path in the diagnostic. | ||
func assertionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assertionFailure(message(), file: (file), line: line) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// Just like Swift.precondition, but includes the full file path in the diagnostic. | ||
func precondition( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.precondition(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.preconditionFailure, but includes the full file path in the diagnostic. | ||
func preconditionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.preconditionFailure(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.fatalError, but includes the full file path in the diagnostic. | ||
func fatalError( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) -> Never { | ||
Swift.fatalError(message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assert, but includes the full file path in the diagnostic. | ||
func assert( | ||
_ condition: @autoclosure () -> Bool, | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assert(condition(), message(), file: (file), line: line) | ||
} | ||
|
||
/// Just like Swift.assertionFailure, but includes the full file path in the diagnostic. | ||
func assertionFailure( | ||
_ message: @autoclosure () -> String = String(), | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
Swift.assertionFailure(message(), file: (file), line: line) | ||
} |
Oops, something went wrong.