Skip to content

Conversation

tschuett
Copy link
Contributor

@tschuett tschuett commented Feb 22, 2021

Replace assert with an error message.

Resolves SR-14256.

I would appreciate some guidance on how to create a test case.

`./swift-frontend -emit-supported-features ./swift

:0: error: not a swift file: './swift'`

Copy link
Contributor

@CodaFi CodaFi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this is the correct solution - it merely silences a symptom of the real problem. I believe you want -emit-supported-features to take a different path, or perhaps report something different to FrontendOptions::shouldActionOnlyParse instead.

@tschuett
Copy link
Contributor Author

tschuett commented Feb 22, 2021

I am wondering, why you have to pass a file at all? It is not reading the file.

It was introduced in:
#34645
by @nkcsgexi

@CodaFi
Copy link
Contributor

CodaFi commented Feb 22, 2021

I am wondering, why you have to pass a file at all?

EDIT: Seems like this flag is intended as a kind of supplementary output flag for a frontend compilation mode, not a flag that you can just use to dump out the version and keep moving.

@tschuett
Copy link
Contributor Author

Well ./swift-frontend -emit-supported-features does not work. It requires an input file.

@nkcsgexi
Copy link
Contributor

You could give the invocation any input file, e.g. %S

@tschuett
Copy link
Contributor Author

But the input file is ignored?

@CodaFi CodaFi requested a review from nkcsgexi February 22, 2021 18:17
@CodaFi
Copy link
Contributor

CodaFi commented Feb 22, 2021

@nkcsgexi Is this intended to be a frontend mode or a supplementary output? If it's the former, then we need to make sure that no input files come along with the invocation. If it's the latter we need to remove the frontend mode.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants