Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 870
Enforce attribute targets on functions#16692
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
fe733485c8d2a85ffd470ac99ccb66c803d99f311e42b6745c532bc39ddd9a16f82303225827ed24c55e1956d4162a07be1bff6c740190e02bc53168cad0b68c9015b22d1b07da19d3706c83d6ee83bd0ac0bc348d2dfafFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -10636,8 +10636,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt | ||
| | ModuleOrMemberBinding, SynBindingKind.StandaloneExpression, _ -> Some(".cctor") | ||
| | _, _, _ -> envinner.eCallerMemberName | ||
| let envinner = {envinner with eCallerMemberName = callerName } | ||
| let envinner = { envinner with eCallerMemberName = callerName } | ||
| let attrTgt = declKind.AllowedAttribTargets memberFlagsOpt | ||
| let isFixed, rhsExpr, overallPatTy, overallExprTy = | ||
| @@ -10873,6 +10872,16 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt | ||
| errorR(Error(FSComp.SR.tcLiteralCannotBeInline(), mBinding)) | ||
| if not (isNil declaredTypars) then | ||
| errorR(Error(FSComp.SR.tcLiteralCannotHaveGenericParameters(), mBinding)) | ||
| if g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargetsOnFunctions) && memberFlagsOpt.IsNone && not attrs.IsEmpty then | ||
psfinaki marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| let rhsIsFunction = isFunTy g overallPatTy | ||
| let lhsIsFunction = isFunTy g overallExprTy | ||
| let attrTgt = | ||
| match rhsIsFunction, lhsIsFunction with | ||
| | false, false when declaredTypars.IsEmpty -> AttributeTargets.Field ||| AttributeTargets.Property ||| AttributeTargets.ReturnValue | ||
| | _, _ -> AttributeTargets.Method ||| AttributeTargets.ReturnValue | ||
| TcAttributesWithPossibleTargets false cenv env attrTgt attrs |> ignore | ||
| CheckedBindingInfo(inlineFlag, valAttribs, xmlDoc, tcPatPhase2, explicitTyparInfo, nameToPrelimValSchemeMap, rhsExprChecked, argAndRetAttribs, overallPatTy, mBinding, debugPoint, isCompGen, literalValue, isFixed), tpenv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -725,12 +725,7 @@ let CheckModuleBinding cenv (isRec: bool) (TBind _ as bind) = | ||
| // warn for non-rec functions which have the attribute | ||
| if cenv.g.langVersion.SupportsFeature LanguageFeature.WarningWhenTailCallAttrOnNonRec then | ||
| let isNotAFunction = | ||
psfinaki marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| match bind.Var.ValReprInfo with | ||
| | Some info -> info.HasNoArgs | ||
| | _ -> false | ||
| if (not isRec || isNotAFunction) && cenv.g.HasTailCallAttrib bind.Var.Attribs then | ||
| if not isRec && cenv.g.HasTailCallAttrib bind.Var.Attribs then | ||
| warning (Error(FSComp.SR.chkTailCallAttrOnNonRec (), bind.Var.Range)) | ||
| // Check if a let binding to the result of a rec expression is not inside the rec expression | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.