-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: When main.tsp only contain minimal import, emitter fails #5419
Comments
We should verify if this issue exists in other languages too. |
http-client-java compiles, but csharp and python client doesn't. There's an open issue - 5363 |
For python, it was already fixed by #5200 so please try latest https://www.npmjs.com/package/@typespec/http-client-python. |
@allenjzhang what is the desired outcome here? A csproj with no cs files? We should evaluate the assumptions we make and have cadl ranch tests for each of those.
|
The call stack is the one I would like to remove. It looked like an uncaught exception. I tried with latest build, the result looks fine to me now with one line error:
BTW, nit, typespec should be TypeSpec. Once that fixed, you can close this issue. Thx |
Probably should be "C# library" and "TypeSpec". We should follow up to find out what PR actually fixed this as it still should have been part of our triage process. |
This was fixed in #5475 |
I don't know if this was fixed would like to confirm with @allenjzhang what the expected result of an emitter should be if there are no clients or models in the spec? Should we throw an error or should we generate an empty library? @srnagar , @joheredi , @lmazuel how are your languages handling this? |
As a general rule, we should not be throwing for "known" error cases. These should instead use error diagnostics. The only time we throw is for "unknown" cases. We should file an issue to scan the emitter to make sure we are following this rule. |
We should fix the casing. But we need to have a Spector test that provides an empty TypeSpec and what the expectation is for this case. Right now, languages are doing different things. |
Adding Spector label since we need a spector scenario for an empty Typespec along with the expectations. |
Describe the bug
Right after
tsp init
with empty project that only,npx tsp compile .
fails.main.tsp only contains following:
Reproduction
In E2E repo,
Checklist
The text was updated successfully, but these errors were encountered: