Skip to content

Instantly share code, notes, and snippets.

@natecook1000
Created October 8, 2014 21:05
Show Gist options
  • Save natecook1000/ce6631a23649dc952d8e to your computer and use it in GitHub Desktop.
Save natecook1000/ce6631a23649dc952d8e to your computer and use it in GitHub Desktop.
Dump the Swift-synthesized headers for a module
#! /bin/sh
# usage: <shellscript> [--osx] typename
if [ "$1" = "--osx" ] ; then
echo ":print_module $2" | xcrun swift -deprecated-integrated-repl
else
sdk_path=$(echo `xcrun --show-sdk-path` | sed 's#MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk#iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk#')
echo ":print_module $1" | xcrun swift -deprecated-integrated-repl -sdk "$sdk_path"
fi
@jtbandes
Copy link

I just learned from https://bugs.swift.org/browse/SR-2502 that :type lookup Foo works in the non-deprecated REPL (just regular swift)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment