mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Somewhat working
Test shadowed variable of same type Fully type check caller side macro expansion Skip macro default arg caller side expr at decl primary Test macro expand more complex expressions Set synthesized expression as implicit Add test case for with argument, not compiling currently Test with swiftinterface Always use the string representation of the default argument Now works across module boundary Check works for multiple files Make default argument expression work in single file Use expected-error Disallow expression macro as default argument Using as a sub expression in default argument still allowed as expression macros behave the same as built-in magic literals
This commit is contained in:
@@ -289,7 +289,8 @@ StringRef SourceManager::getIdentifierForBuffer(
|
||||
if (auto generatedInfo = getGeneratedSourceInfo(bufferID)) {
|
||||
// We only care about macros, so skip everything else.
|
||||
if (generatedInfo->kind == GeneratedSourceInfo::ReplacedFunctionBody ||
|
||||
generatedInfo->kind == GeneratedSourceInfo::PrettyPrinted)
|
||||
generatedInfo->kind == GeneratedSourceInfo::PrettyPrinted ||
|
||||
generatedInfo->kind == GeneratedSourceInfo::DefaultArgument)
|
||||
return buffer->getBufferIdentifier();
|
||||
|
||||
if (generatedInfo->onDiskBufferCopyFileName.empty()) {
|
||||
@@ -382,6 +383,7 @@ void SourceManager::setGeneratedSourceInfo(
|
||||
case GeneratedSourceInfo::Name##MacroExpansion:
|
||||
#include "swift/Basic/MacroRoles.def"
|
||||
case GeneratedSourceInfo::PrettyPrinted:
|
||||
case GeneratedSourceInfo::DefaultArgument:
|
||||
break;
|
||||
|
||||
case GeneratedSourceInfo::ReplacedFunctionBody:
|
||||
|
||||
Reference in New Issue
Block a user