From b869e16bab9b41dba4a53a2c6fb90a39c895983a Mon Sep 17 00:00:00 2001
From: "dotnet-maestro[bot]"
<42748379+dotnet-maestro[bot]@users.noreply.github.com>
Date: Thu, 1 Aug 2019 17:15:13 -0700
Subject: [PATCH 001/146] Update dependencies from
https://github.com/dotnet/arcade build 20190731.19 (#7320)
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19381.19
---
eng/Version.Details.xml | 4 +-
eng/common/init-tools-native.sh | 4 +-
eng/common/native/install-cmake-test.sh | 117 ++++++++++++++++++++++++
eng/common/native/install-cmake.sh | 2 +-
eng/common/templates/job/job.yml | 6 +-
global.json | 2 +-
6 files changed, 128 insertions(+), 7 deletions(-)
create mode 100755 eng/common/native/install-cmake-test.sh
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 92b380533f..e94e911d91 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -3,9 +3,9 @@
-
+
https://github.com/dotnet/arcade
- def377f94747dac91482aad67b33a1c011ffc770
+ 48787606d809963cc800151cbfbefe0a74ae74b4
diff --git a/eng/common/init-tools-native.sh b/eng/common/init-tools-native.sh
index 5f2e77f448..4dafaaca13 100755
--- a/eng/common/init-tools-native.sh
+++ b/eng/common/init-tools-native.sh
@@ -70,8 +70,7 @@ function ReadGlobalJsonNativeTools {
# Only extract the contents of the object.
local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}')
native_tools_list=${native_tools_list//[\" ]/}
- native_tools_list=${native_tools_list//,/$'\n'}
- native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[[:space:]]')"
+ native_tools_list=$( echo "$native_tools_list" | sed 's/\s//g' | sed 's/,/\n/g' )
local old_IFS=$IFS
while read -r line; do
@@ -108,6 +107,7 @@ else
installer_command+=" --baseuri $base_uri"
installer_command+=" --installpath $install_bin"
installer_command+=" --version $tool_version"
+ echo $installer_command
if [[ $force = true ]]; then
installer_command+=" --force"
diff --git a/eng/common/native/install-cmake-test.sh b/eng/common/native/install-cmake-test.sh
new file mode 100755
index 0000000000..53ddf4e686
--- /dev/null
+++ b/eng/common/native/install-cmake-test.sh
@@ -0,0 +1,117 @@
+#!/usr/bin/env bash
+
+source="${BASH_SOURCE[0]}"
+scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+
+. $scriptroot/common-library.sh
+
+base_uri=
+install_path=
+version=
+clean=false
+force=false
+download_retries=5
+retry_wait_time_seconds=30
+
+while (($# > 0)); do
+ lowerI="$(echo $1 | awk '{print tolower($0)}')"
+ case $lowerI in
+ --baseuri)
+ base_uri=$2
+ shift 2
+ ;;
+ --installpath)
+ install_path=$2
+ shift 2
+ ;;
+ --version)
+ version=$2
+ shift 2
+ ;;
+ --clean)
+ clean=true
+ shift 1
+ ;;
+ --force)
+ force=true
+ shift 1
+ ;;
+ --downloadretries)
+ download_retries=$2
+ shift 2
+ ;;
+ --retrywaittimeseconds)
+ retry_wait_time_seconds=$2
+ shift 2
+ ;;
+ --help)
+ echo "Common settings:"
+ echo " --baseuri Base file directory or Url wrom which to acquire tool archives"
+ echo " --installpath Base directory to install native tool to"
+ echo " --clean Don't install the tool, just clean up the current install of the tool"
+ echo " --force Force install of tools even if they previously exist"
+ echo " --help Print help and exit"
+ echo ""
+ echo "Advanced settings:"
+ echo " --downloadretries Total number of retry attempts"
+ echo " --retrywaittimeseconds Wait time between retry attempts in seconds"
+ echo ""
+ exit 0
+ ;;
+ esac
+done
+
+tool_name="cmake-test"
+tool_os=$(GetCurrentOS)
+tool_folder=$(echo $tool_os | awk '{print tolower($0)}')
+tool_arch="x86_64"
+tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch"
+tool_install_directory="$install_path/$tool_name/$version"
+tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name"
+shim_path="$install_path/$tool_name.sh"
+uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz"
+
+# Clean up tool and installers
+if [[ $clean = true ]]; then
+ echo "Cleaning $tool_install_directory"
+ if [[ -d $tool_install_directory ]]; then
+ rm -rf $tool_install_directory
+ fi
+
+ echo "Cleaning $shim_path"
+ if [[ -f $shim_path ]]; then
+ rm -rf $shim_path
+ fi
+
+ tool_temp_path=$(GetTempPathFileName $uri)
+ echo "Cleaning $tool_temp_path"
+ if [[ -f $tool_temp_path ]]; then
+ rm -rf $tool_temp_path
+ fi
+
+ exit 0
+fi
+
+# Install tool
+if [[ -f $tool_file_path ]] && [[ $force = false ]]; then
+ echo "$tool_name ($version) already exists, skipping install"
+ exit 0
+fi
+
+DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds
+
+if [[ $? != 0 ]]; then
+ echo "Installation failed" >&2
+ exit 1
+fi
+
+# Generate Shim
+# Always rewrite shims so that we are referencing the expected version
+NewScriptShim $shim_path $tool_file_path true
+
+if [[ $? != 0 ]]; then
+ echo "Shim generation failed" >&2
+ exit 1
+fi
+
+exit 0
\ No newline at end of file
diff --git a/eng/common/native/install-cmake.sh b/eng/common/native/install-cmake.sh
index 293af6017d..5f1a182fa9 100755
--- a/eng/common/native/install-cmake.sh
+++ b/eng/common/native/install-cmake.sh
@@ -69,7 +69,7 @@ tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch"
tool_install_directory="$install_path/$tool_name/$version"
tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name"
shim_path="$install_path/$tool_name.sh"
-uri="${base_uri}/$tool_folder/cmake/$tool_name_moniker.tar.gz"
+uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz"
# Clean up tool and installers
if [[ $clean = true ]]; then
diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml
index 1814e0ab61..8db456bb7f 100644
--- a/eng/common/templates/job/job.yml
+++ b/eng/common/templates/job/job.yml
@@ -37,6 +37,9 @@ parameters:
# Optional: Enable publishing to the build asset registry
enablePublishBuildAssets: false
+ # Optional: Prevent gather/push manifest from executing when using publishing pipelines
+ enablePublishUsingPipelines: false
+
# Optional: Include PublishTestResults task
enablePublishTestResults: false
@@ -187,7 +190,7 @@ jobs:
continueOnError: true
condition: always()
- - ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(variables['_PublishUsingPipelines'], 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
+ - ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: CopyFiles@2
displayName: Gather Asset Manifests
inputs:
@@ -195,6 +198,7 @@ jobs:
TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
+
- task: PublishBuildArtifacts@1
displayName: Push Asset Manifests
inputs:
diff --git a/global.json b/global.json
index 341cf08499..0a08d8518b 100644
--- a/global.json
+++ b/global.json
@@ -10,7 +10,7 @@
}
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19380.3",
+ "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19381.19",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2"
}
}
From 3e7cdd559c6d5729b1a0482256e3af87816d7f69 Mon Sep 17 00:00:00 2001
From: Don Syme
Date: Fri, 2 Aug 2019 02:15:22 +0100
Subject: [PATCH 002/146] debug formatting (#7196)
* debug formatting
* whitespace
* whitespace
* Update DetupleArgs.fs
---
src/absil/ilreflect.fs | 2 +
src/absil/ilwrite.fs | 1 +
src/fsharp/ConstraintSolver.fs | 107 ++++++++++++++++++++++--------
src/fsharp/DetupleArgs.fs | 16 +++--
src/fsharp/FindUnsolved.fs | 2 +
src/fsharp/IlxGen.fs | 19 +++++-
src/fsharp/Optimizer.fs | 4 ++
src/fsharp/PostInferenceChecks.fs | 21 +++++-
src/fsharp/TypeChecker.fs | 2 +-
src/fsharp/autobox.fs | 2 +
src/ilx/EraseClosures.fs | 14 +++-
11 files changed, 153 insertions(+), 37 deletions(-)
diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs
index 404ebf81b0..152b2bf54d 100644
--- a/src/absil/ilreflect.fs
+++ b/src/absil/ilreflect.fs
@@ -327,6 +327,8 @@ type cenv =
generatePdb: bool
resolveAssemblyRef: (ILAssemblyRef -> Choice option) }
+ override x.ToString() = ""
+
/// Convert an Abstract IL type reference to Reflection.Emit System.Type value.
// This ought to be an adequate substitute for this whole function, but it needs
// to be thoroughly tested.
diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs
index 66d2dd9a66..47aa56664d 100644
--- a/src/absil/ilwrite.fs
+++ b/src/absil/ilwrite.fs
@@ -605,6 +605,7 @@ type cenv =
member cenv.GetCode() = cenv.codeChunks.Close()
+ override x.ToString() = ""
let FindOrAddSharedRow (cenv: cenv) tbl x = cenv.GetTable(tbl).FindOrAddSharedEntry x
diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs
index 4f00fd73ed..188eba19cb 100644
--- a/src/fsharp/ConstraintSolver.fs
+++ b/src/fsharp/ConstraintSolver.fs
@@ -64,10 +64,10 @@ let compgenId = mkSynId range0 unassignedTyparName
let NewCompGenTypar (kind, rigid, staticReq, dynamicReq, error) =
NewTypar(kind, rigid, Typar(compgenId, staticReq, true), error, dynamicReq, [], false, false)
-let anon_id m = mkSynId m unassignedTyparName
+let AnonTyparId m = mkSynId m unassignedTyparName
let NewAnonTypar (kind, m, rigid, var, dyn) =
- NewTypar (kind, rigid, Typar(anon_id m, var, true), false, dyn, [], false, false)
+ NewTypar (kind, rigid, Typar(AnonTyparId m, var, true), false, dyn, [], false, false)
let NewNamedInferenceMeasureVar (_m, rigid, var, id) =
NewTypar(TyparKind.Measure, rigid, Typar(id, var, false), false, TyparDynamicReq.No, [], false, false)
@@ -104,6 +104,7 @@ let FreshenAndFixupTypars m rigid fctps tinst tpsorig =
tps, renaming, tinst
let FreshenTypeInst m tpsorig = FreshenAndFixupTypars m TyparRigidity.Flexible [] [] tpsorig
+
let FreshMethInst m fctps tinst tpsorig = FreshenAndFixupTypars m TyparRigidity.Flexible fctps tinst tpsorig
let FreshenTypars m tpsorig =
@@ -126,62 +127,95 @@ let FreshenMethInfo m (minfo: MethInfo) =
[]
/// Information about the context of a type equation.
type ContextInfo =
+
/// No context was given.
| NoContext
+
/// The type equation comes from an IF expression.
| IfExpression of range
+
/// The type equation comes from an omitted else branch.
| OmittedElseBranch of range
+
/// The type equation comes from a type check of the result of an else branch.
| ElseBranchResult of range
+
/// The type equation comes from the verification of record fields.
| RecordFields
+
/// The type equation comes from the verification of a tuple in record fields.
| TupleInRecordFields
+
/// The type equation comes from a list or array constructor
| CollectionElement of bool * range
+
/// The type equation comes from a return in a computation expression.
+
| ReturnInComputationExpression
+
/// The type equation comes from a yield in a computation expression.
| YieldInComputationExpression
+
/// The type equation comes from a runtime type test.
| RuntimeTypeTest of bool
+
/// The type equation comes from an downcast where a upcast could be used.
| DowncastUsedInsteadOfUpcast of bool
+
/// The type equation comes from a return type of a pattern match clause (not the first clause).
| FollowingPatternMatchClause of range
+
/// The type equation comes from a pattern match guard.
| PatternMatchGuard of range
+
/// The type equation comes from a sequence expression.
| SequenceExpression of TType
-exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range
-exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range
-exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * TType * range * range * ContextInfo
+exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range
+
+exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range
+
+exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * TType * range * range * ContextInfo
+
exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * TType * TType * range * range
-exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Tast.Typar * Tast.TyparConstraint * range * range
-exception ConstraintSolverError of string * range * range
-exception ConstraintSolverRelatedInformation of string option * range * exn
-exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Tast.Typar * TType * exn * range
-exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * range
+exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Tast.Typar * Tast.TyparConstraint * range * range
+
+exception ConstraintSolverError of string * range * range
+
+exception ConstraintSolverRelatedInformation of string option * range * exn
+
+exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Tast.Typar * TType * exn * range
+
+exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * range
+
exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * ContextInfo * range
-exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range
-exception PossibleOverload of displayEnv: DisplayEnv * string * exn * range
-exception UnresolvedOverloading of displayEnv: DisplayEnv * exn list * string * range
-exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range
+
+exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range
+
+exception PossibleOverload of displayEnv: DisplayEnv * string * exn * range
+
+exception UnresolvedOverloading of displayEnv: DisplayEnv * exn list * string * range
+
+exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range
let GetPossibleOverloads amap m denv (calledMethGroup: (CalledMeth<_> * exn) list) =
- calledMethGroup |> List.map (fun (cmeth, e) -> PossibleOverload(denv, NicePrint.stringOfMethInfo amap m denv cmeth.Method, e, m))
+ calledMethGroup |> List.map (fun (cmeth, e) ->
+ PossibleOverload(denv, NicePrint.stringOfMethInfo amap m denv cmeth.Method, e, m))
type TcValF = (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType)
type ConstraintSolverState =
{
g: TcGlobals
+
amap: Import.ImportMap
+
InfoReader: InfoReader
+
+ /// The function used to freshen values we encounter during trait constraint solving
TcVal: TcValF
+
/// This table stores all unsolved, ungeneralized trait constraints, indexed by free type variable.
/// That is, there will be one entry in this table for each free type variable in
/// each outstanding, unsolved, ungeneralized trait constraint. Constraints are removed from the table and resolved
@@ -196,20 +230,29 @@ type ConstraintSolverState =
InfoReader = infoReader
TcVal = tcVal }
-
type ConstraintSolverEnv =
{
SolverState: ConstraintSolverState
+
eContextInfo: ContextInfo
+
MatchingOnly: bool
+
m: range
+
EquivEnv: TypeEquivEnv
+
DisplayEnv: DisplayEnv
}
+
member csenv.InfoReader = csenv.SolverState.InfoReader
+
member csenv.g = csenv.SolverState.g
+
member csenv.amap = csenv.SolverState.amap
+ override csenv.ToString() = " @ " + csenv.m.ToString()
+
let MakeConstraintSolverEnv contextInfo css m denv =
{ SolverState = css
m = m
@@ -219,11 +262,6 @@ let MakeConstraintSolverEnv contextInfo css m denv =
EquivEnv = TypeEquivEnv.Empty
DisplayEnv = denv }
-
-//-------------------------------------------------------------------------
-// Occurs check
-//-------------------------------------------------------------------------
-
/// Check whether a type variable occurs in the r.h.s. of a type, e.g. to catch
/// infinite equations such as
/// 'a = list<'a>
@@ -287,9 +325,13 @@ let isDecimalTy g ty =
typeEquivAux EraseMeasures g g.decimal_ty ty
let IsNonDecimalNumericOrIntegralEnumType g ty = isIntegerOrIntegerEnumTy g ty || isFpTy g ty
+
let IsNumericOrIntegralEnumType g ty = IsNonDecimalNumericOrIntegralEnumType g ty || isDecimalTy g ty
+
let IsNonDecimalNumericType g ty = isIntegerTy g ty || isFpTy g ty
+
let IsNumericType g ty = IsNonDecimalNumericType g ty || isDecimalTy g ty
+
let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g ty || isBoolTy g ty
// Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1>
@@ -386,8 +428,11 @@ let ShowAccessDomain ad =
// Solve
exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range
+
exception LocallyAbortOperationThatFailsToResolveOverload
+
exception LocallyAbortOperationThatLosesAbbrevs
+
let localAbortD = ErrorD LocallyAbortOperationThatLosesAbbrevs
/// Return true if we would rather unify this variable v1 := v2 than vice versa
@@ -652,7 +697,6 @@ let NormalizeExponentsInTypeScheme uvars ty =
SubstMeasure v (Measure.RationalPower (Measure.Var v', DivRational OneRational expGcd))
v')
-
// We normalize unit-of-measure-polymorphic type schemes. There
// are three reasons for doing this:
// (1) to present concise and consistent type schemes to the programmer
@@ -732,8 +776,6 @@ let rec SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optio
// Record a entry in the undo trace if one is provided
trace.Exec (fun () -> r.typar_solution <- Some ty) (fun () -> r.typar_solution <- None)
- (* dprintf "setting typar %d to type %s at %a\n" r.Stamp ((DebugPrint.showType ty)) outputRange m; *)
-
// Only solve constraints if this is not an error var
if r.IsFromError then () else
// Check to see if this type variable is relevant to any trait constraints.
@@ -745,15 +787,17 @@ let rec SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optio
| _ -> failwith "SolveTyparEqualsType"
}
-
/// Apply the constraints on 'typar' to the type 'ty'
and solveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty (r: Typar) = trackErrors {
let g = csenv.g
+
// Propagate compat flex requirements from 'tp' to 'ty'
do! SolveTypIsCompatFlex csenv trace r.IsCompatFlex ty
+
// Propagate dynamic requirements from 'tp' to 'ty'
do! SolveTypDynamicReq csenv trace r.DynamicReq ty
+
// Propagate static requirements from 'tp' to 'ty'
do! SolveTypStaticReq csenv trace r.StaticReq ty
@@ -899,6 +943,7 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional
let amap = csenv.amap
let aenv = csenv.EquivEnv
let denv = csenv.DisplayEnv
+
match sty1, sty2 with
| TType_var tp1, _ ->
match aenv.EquivTypars.TryFind tp1 with
@@ -914,15 +959,19 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional
| TType_tuple (tupInfo1, l1), TType_tuple (tupInfo2, l2) ->
if evalTupInfoIsStruct tupInfo1 <> evalTupInfoIsStruct tupInfo2 then ErrorD (ConstraintSolverError(FSComp.SR.tcTupleStructMismatch(), csenv.m, m2)) else
SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2 (* nb. can unify since no variance *)
+
| TType_anon (anonInfo1, l1), TType_anon (anonInfo2, l2) ->
SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () ->
SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2) (* nb. can unify since no variance *)
+
| TType_fun (d1, r1), TType_fun (d2, r2) -> SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 (* nb. can unify since no variance *)
+
| TType_measure ms1, TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2
// Enforce the identities float=float<1>, float32=float32<1> and decimal=decimal<1>
| (_, TType_app (tc2, [ms])) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty1 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms]))
-> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms (TType_measure Measure.One)
+
| (TType_app (tc2, [ms]), _) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty2 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms]))
-> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms (TType_measure Measure.One)
@@ -973,6 +1022,7 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional
let ty2arg = destArrayTy g ty2
SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ty1arg ty2arg
| _ -> error(InternalError("destArrayTy", m))
+
| _ ->
// D :> Head<_> --> C :> Head<_> for the
// first interface or super-class C supported by D which
@@ -991,7 +1041,6 @@ and SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m2 trace cxsln ty1 ty2 =
// Solve and record non-equality constraints
//-------------------------------------------------------------------------
-
and SolveTyparSubtypeOfType (csenv: ConstraintSolverEnv) ndeep m2 trace tp ty1 =
let g = csenv.g
if isObjTy g ty1 then CompleteD
@@ -1052,7 +1101,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload
| _ -> do! ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2))
// Trait calls are only supported on pseudo type (variables)
for e in tys do
- do! SolveTypStaticReq csenv trace HeadTypeStaticReq e
+ do! SolveTypStaticReq csenv trace HeadTypeStaticReq e
let argtys = if memFlags.IsInstance then List.tail argtys else argtys
@@ -1108,14 +1157,18 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload
do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 (mkAppTy tcref [TType_measure ms2])
do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))])
return TTraitBuiltIn
+
| _ ->
+
match GetMeasureOfType g argty2 with
| Some (tcref, ms2) ->
let ms1 = freshMeasure ()
do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure ms1])
do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))])
return TTraitBuiltIn
+
| _ ->
+
do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1
do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1
return TTraitBuiltIn
diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs
index 8ae41acb31..b15bae8f24 100644
--- a/src/fsharp/DetupleArgs.fs
+++ b/src/fsharp/DetupleArgs.fs
@@ -644,17 +644,26 @@ let hasTransfrom penv f = Zmap.tryFind f penv.transforms
*)
type env =
- { eg : TcGlobals
- prefix : string
- m : Range.range }
+ {
+ eg: TcGlobals
+
+ prefix: string
+
+ m: Range.range
+ }
+
+ override __.ToString() = ""
let suffixE env s = {env with prefix = env.prefix + s}
+
let rangeE env m = {env with m = m}
let push b bs = b :: bs
+
let pushL xs bs = xs@bs
let newLocal env ty = mkCompGenLocal env.m env.prefix ty
+
let newLocalN env i ty = mkCompGenLocal env.m (env.prefix + string i) ty
let noEffectExpr env bindings x =
@@ -712,7 +721,6 @@ and collapseArgs env bindings n (callPattern) args =
| _ts :: _tss, [] ->
internalError "collapseArgs: CallPattern longer than callsite args. REPORT BUG"
-
//-------------------------------------------------------------------------
// pass - app fixup
//-------------------------------------------------------------------------
diff --git a/src/fsharp/FindUnsolved.fs b/src/fsharp/FindUnsolved.fs
index ac64aa6c1d..d11a128417 100644
--- a/src/fsharp/FindUnsolved.fs
+++ b/src/fsharp/FindUnsolved.fs
@@ -21,6 +21,8 @@ type cenv =
denv: DisplayEnv
mutable unsolved: Typars }
+ override x.ToString() = ""
+
/// Walk types, collecting type variables
let accTy cenv _env ty =
let normalizedTy = tryNormalizeMeasureInType cenv.g ty
diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs
index 6b66a6a8ab..5e61742fd9 100644
--- a/src/fsharp/IlxGen.fs
+++ b/src/fsharp/IlxGen.fs
@@ -253,6 +253,8 @@ type cenv =
delayedGenMethods: Queue unit>
}
+ override x.ToString() = ""
+
let mkTypeOfExpr cenv m ilty =
let g = cenv.g
@@ -771,17 +773,26 @@ and NamedLocalIlxClosureInfo =
| NamedLocalIlxClosureInfoGenerator of (IlxGenEnv -> IlxClosureInfo)
| NamedLocalIlxClosureInfoGenerated of IlxClosureInfo
+ override __.ToString() = ""
+
/// Indicates the overall representation decisions for all the elements of a namespace of module
and ModuleStorage =
- { Vals: Lazy>
- SubModules: Lazy> }
+ {
+ Vals: Lazy>
+
+ SubModules: Lazy>
+ }
+
+ override __.ToString() = ""
/// Indicate whether a call to the value can be implemented as
/// a branch. At the moment these are only used for generating branch calls back to
/// the entry label of the method currently being generated when a direct tailcall is
/// made in the method itself.
and BranchCallItem =
+
| BranchCallClosure of ArityInfo
+
| BranchCallMethod of
// Argument counts for compiled form of F# method or value
ArityInfo *
@@ -793,6 +804,8 @@ and BranchCallItem =
int *
// num obj args
int
+
+ override __.ToString() = ""
/// Represents a place we can branch to
and Mark =
@@ -837,6 +850,8 @@ and IlxGenEnv =
isInLoop: bool
}
+ override __.ToString() = ""
+
let SetIsInLoop isInLoop eenv =
if eenv.isInLoop = isInLoop then eenv
else { eenv with isInLoop = isInLoop }
diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs
index ecc24b9131..cfa1a9a49d 100644
--- a/src/fsharp/Optimizer.fs
+++ b/src/fsharp/Optimizer.fs
@@ -380,6 +380,8 @@ type cenv =
casApplied : Dictionary
}
+ override x.ToString() = ""
+
type IncrementalOptimizationEnv =
{ /// An identifier to help with name generation
latestBoundId: Ident option
@@ -415,6 +417,8 @@ type IncrementalOptimizationEnv =
localExternalVals = LayeredMap.Empty
globalModuleInfos = LayeredMap.Empty }
+ override x.ToString() = ""
+
//-------------------------------------------------------------------------
// IsPartialExprVal - is the expr fully known?
//-------------------------------------------------------------------------
diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs
index b6a286c5d7..d6ad0cdf64 100644
--- a/src/fsharp/PostInferenceChecks.fs
+++ b/src/fsharp/PostInferenceChecks.fs
@@ -93,7 +93,10 @@ type env =
returnScope : int
/// Are we in an app expression (Expr.App)?
- isInAppExpr: bool }
+ isInAppExpr: bool
+ }
+
+ override __.ToString() = ""
let BindTypar env (tp: Typar) =
{ env with
@@ -183,23 +186,39 @@ let CombineLimits limits =
type cenv =
{ boundVals: Dictionary // really a hash set
+
limitVals: Dictionary
+
mutable potentialUnboundUsesOfVals: StampMap
+
mutable anonRecdTypes: StampMap
+
g: TcGlobals
+
amap: Import.ImportMap
+
/// For reading metadata
infoReader: InfoReader
+
internalsVisibleToPaths : CompilationPath list
+
denv: DisplayEnv
+
viewCcu : CcuThunk
+
reportErrors: bool
+
isLastCompiland : bool*bool
+
isInternalTestSpanStackReferring: bool
+
// outputs
mutable usesQuotations : bool
+
mutable entryPointGiven: bool }
+ override x.ToString() = ""
+
/// Check if the value is an argument of a function
let IsValArgument env (v: Val) =
env.argVals.ContainsVal v
diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs
index 70bb0f6b21..7610c4f209 100644
--- a/src/fsharp/TypeChecker.fs
+++ b/src/fsharp/TypeChecker.fs
@@ -534,7 +534,7 @@ type cenv =
conditionalDefines = conditionalDefines
isInternalTestSpanStackReferring = isInternalTestSpanStackReferring }
- override __.ToString() = "cenv(...)"
+ override __.ToString() = ""
let CopyAndFixupTypars m rigid tpsorig =
ConstraintSolver.FreshenAndFixupTypars m rigid [] [] tpsorig
diff --git a/src/fsharp/autobox.fs b/src/fsharp/autobox.fs
index da6b5c1d64..8c7036e72c 100644
--- a/src/fsharp/autobox.fs
+++ b/src/fsharp/autobox.fs
@@ -18,6 +18,8 @@ type cenv =
{ g: TcGlobals
amap: Import.ImportMap }
+ override x.ToString() = ""
+
/// Find all the mutable locals that escape a method, function or lambda expression
let DecideEscapes syntacticArgs body =
let cantBeFree v =
diff --git a/src/ilx/EraseClosures.fs b/src/ilx/EraseClosures.fs
index 3ba574b9ba..ca0dbfcdf8 100644
--- a/src/ilx/EraseClosures.fs
+++ b/src/ilx/EraseClosures.fs
@@ -116,12 +116,22 @@ let mkFuncTypeRef n =
[IlxSettings.ilxNamespace () + ".OptimizedClosures"],
"FSharpFunc`"+ string (n + 1))
type cenv =
- { ilg:ILGlobals
+ {
+ ilg:ILGlobals
+
tref_Func: ILTypeRef[]
+
mkILTyFuncTy: ILType
+
addFieldGeneratedAttrs: ILFieldDef -> ILFieldDef
+
addFieldNeverAttrs: ILFieldDef -> ILFieldDef
- addMethodGeneratedAttrs: ILMethodDef -> ILMethodDef }
+
+ addMethodGeneratedAttrs: ILMethodDef -> ILMethodDef
+ }
+
+ override __.ToString() = ""
+
let addMethodGeneratedAttrsToTypeDef cenv (tdef: ILTypeDef) =
tdef.With(methods = (tdef.Methods.AsList |> List.map (fun md -> md |> cenv.addMethodGeneratedAttrs) |> mkILMethods))
From 3a479d8601ddc8d0e7c25b41db71f825b62b9b8f Mon Sep 17 00:00:00 2001
From: Steffen Forkmann
Date: Fri, 2 Aug 2019 04:39:22 +0200
Subject: [PATCH 003/146] test output (#7289)
---
tests/fsharp/Compiler/CompilerAssert.fs | 27 ++++++++++++++++---------
tests/fsharpqa/Source/Simple/env.lst | 1 -
tests/fsharpqa/Source/Simple/hellow.fs | 7 -------
tests/fsharpqa/Source/test.lst | 1 -
4 files changed, 17 insertions(+), 19 deletions(-)
delete mode 100644 tests/fsharpqa/Source/Simple/env.lst
delete mode 100644 tests/fsharpqa/Source/Simple/hellow.fs
diff --git a/tests/fsharp/Compiler/CompilerAssert.fs b/tests/fsharp/Compiler/CompilerAssert.fs
index c663e9b9c2..4c11d90ecd 100644
--- a/tests/fsharp/Compiler/CompilerAssert.fs
+++ b/tests/fsharp/Compiler/CompilerAssert.fs
@@ -110,7 +110,7 @@ let main argv = 0"""
#if !NETCOREAPP
OtherOptions = [|"--preferreduilang:en-US";|]
#else
- OtherOptions =
+ OtherOptions =
let assemblies = getNetCoreAppReferences |> Array.map (fun x -> sprintf "-r:%s" x)
Array.append [|"--preferreduilang:en-US"; "--targetprofile:netcore"; "--noframework"|] assemblies
#endif
@@ -175,12 +175,12 @@ let main argv = 0"""
let TypeCheckWithErrorsAndOptions options (source: string) expectedTypeErrors =
lock gate <| fun () ->
- let parseResults, fileAnswer =
+ let parseResults, fileAnswer =
checker.ParseAndCheckFileInProject(
"test.fs",
0,
SourceText.ofString source,
- { defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions})
+ { defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions})
|> Async.RunSynchronously
Assert.IsEmpty(parseResults.Errors, sprintf "Parse errors: %A" parseResults.Errors)
@@ -189,7 +189,7 @@ let main argv = 0"""
| FSharpCheckFileAnswer.Aborted _ -> Assert.Fail("Type Checker Aborted")
| FSharpCheckFileAnswer.Succeeded(typeCheckResults) ->
- let errors =
+ let errors =
typeCheckResults.Errors
|> Array.distinctBy (fun e -> e.Severity, e.ErrorNumber, e.StartLineAlternate, e.StartColumn, e.EndLineAlternate, e.EndColumn, e.Message)
@@ -234,7 +234,7 @@ let main argv = 0"""
pInfo.RedirectStandardError <- true
pInfo.UseShellExecute <- false
-
+
let p = Process.Start(pInfo)
p.WaitForExit()
@@ -247,13 +247,13 @@ let main argv = 0"""
)
let CompileLibraryAndVerifyIL (source: string) (f: ILVerifier -> unit) =
- compile false source (fun (errors, outputFilePath) ->
+ compile false source (fun (errors, outputFilePath) ->
if errors.Length > 0 then
Assert.Fail (sprintf "Compile had warnings and/or errors: %A" errors)
f (ILVerifier outputFilePath)
)
-
+
let RunScript (source: string) (expectedErrorMessages: string list) =
lock gate <| fun () ->
// Intialize output and input streams
@@ -271,7 +271,7 @@ let main argv = 0"""
let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration()
use fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream, collectible = true)
-
+
let ch, errors = fsiSession.EvalInteractionNonThrowing source
let errorMessages = ResizeArray()
@@ -297,7 +297,7 @@ let main argv = 0"""
Assert.True(parseResults.ParseHadErrors)
- let errors =
+ let errors =
parseResults.Errors
|> Array.distinctBy (fun e -> e.Severity, e.ErrorNumber, e.StartLineAlternate, e.StartColumn, e.EndLineAlternate, e.EndColumn, e.Message)
@@ -310,4 +310,11 @@ let main argv = 0"""
Assert.AreEqual(expectedErrorNumber, info.ErrorNumber, "expectedErrorNumber")
Assert.AreEqual(expectedErrorRange, (info.StartLineAlternate, info.StartColumn + 1, info.EndLineAlternate, info.EndColumn + 1), "expectedErrorRange")
Assert.AreEqual(expectedErrorMsg, info.Message, "expectedErrorMsg")
- )
\ No newline at end of file
+ )
+
+ []
+ let ``hello world``() =
+ CompileExeAndRun
+ """
+(printfn "Hello, world."; exit 0)
+ """
\ No newline at end of file
diff --git a/tests/fsharpqa/Source/Simple/env.lst b/tests/fsharpqa/Source/Simple/env.lst
deleted file mode 100644
index b6c57be84f..0000000000
--- a/tests/fsharpqa/Source/Simple/env.lst
+++ /dev/null
@@ -1 +0,0 @@
-PRI0 SOURCE=hellow.fs # HelloW
\ No newline at end of file
diff --git a/tests/fsharpqa/Source/Simple/hellow.fs b/tests/fsharpqa/Source/Simple/hellow.fs
deleted file mode 100644
index e2d89fde3e..0000000000
--- a/tests/fsharpqa/Source/Simple/hellow.fs
+++ /dev/null
@@ -1,7 +0,0 @@
-//
-
-//<