Skip to content

Add KeywordString to SynConst. #11482

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

Merged
merged 2 commits into from
Apr 29, 2021
Merged

Add KeywordString to SynConst. #11482

merged 2 commits into from
Apr 29, 2021

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Apr 24, 2021

Fixes #11477.

Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

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

Thanks!

@KevinRansom
Copy link
Contributor

KevinRansom commented Apr 28, 2021

@nojaf -- KeywordString doesn't really mean anything to me, and naming is the hardest problem in computer science.

Would perhaps SourceIdentifier be better, I note that the documentation for C# calls those values: source-line-file-path-identifiers
https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/source-line-file-path-identifiers

Just a thought, I really don't want to bikeshed.

@nojaf
Copy link
Contributor Author

nojaf commented Apr 28, 2021

Hey Kevin, I'm totally ok with a different name.

Copy link
Contributor

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

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

Once the baseline is updated this will be good to go.

Thanks

@nojaf
Copy link
Contributor Author

nojaf commented Apr 28, 2021

Thanks, forgot about SurfaceAreaTest indeed.

@KevinRansom
Copy link
Contributor

@nojaf , thanks mate, it gets me every single time :-)

@alfonsogarciacaro
Copy link
Contributor

After updating Fable with latest FCS code I'm getting problems when passing __SOURCE_DIRECTORY__ as static parameter. Example:

open Zanaptak.TypedCssClasses

type Css = CssClasses<"./style.module.css", Naming.PascalCase, resolutionFolder=__SOURCE_DIRECTORY__>

Error in Fable logs:

Invalid static argument to provided type. Expected an argument of kind 'string'. (code 3045)

Can it be related to this?

@nojaf
Copy link
Contributor Author

nojaf commented Jun 26, 2021

Possibly, the AST for this does indeed use the new SynConst.

StaticConstantNamed
                              (LongIdent
                                 (LongIdentWithDots ([resolutionFolder], [])),
                               StaticConstant
                                 (SourceIdentifier
                                    ("__SOURCE_DIRECTORY__",
                                     "/workspace/fantomas-tools/src/server/ASTViewer/bin/output",
                                     tmp.fsx (3,80--3,100) IsSynthetic=false),
                                  tmp.fsx (3,80--3,100) IsSynthetic=false),
                               tmp.fsx (3,63--3,100) IsSynthetic=false)

@alfonsogarciacaro
Copy link
Contributor

Ah, sorry. I just realized this was fixed by #11610, we just need to pull the latest changes in Fable.

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.

Add KeywordString to SynConst type
5 participants