]
+type Trace
type OptionalTrace =
| NoTrace
diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs
index 640459eb3a0..8b96ebb196d 100644
--- a/src/fsharp/DetupleArgs.fs
+++ b/src/fsharp/DetupleArgs.fs
@@ -227,13 +227,13 @@ module GlobalUsageAnalysis =
let logNonRecBinding z (bind:Binding) =
let v = bind.Var
let vs = FlatList.one v
- {z with RecursiveBindings = Zmap.add v (false,vs) z.RecursiveBindings;
+ {z with RecursiveBindings = Zmap.add v (false,vs) z.RecursiveBindings
Defns = Zmap.add v bind.Expr z.Defns }
/// Log the definition of a recursive binding
let logRecBindings z binds =
let vs = valsOfBinds binds
- {z with RecursiveBindings = (z.RecursiveBindings,vs) ||> FlatList.fold (fun mubinds v -> Zmap.add v (true,vs) mubinds);
+ {z with RecursiveBindings = (z.RecursiveBindings,vs) ||> FlatList.fold (fun mubinds v -> Zmap.add v (true,vs) mubinds)
Defns = (z.Defns,binds) ||> FlatList.fold (fun eqns bind -> Zmap.add bind.Var bind.Expr eqns) }
/// Work locally under a lambda of some kind
@@ -285,7 +285,7 @@ module GlobalUsageAnalysis =
| _ ->
// NO: app but function is not val
None
- | Expr.Op(TOp.TupleFieldGet (n),ts,[x],_) ->
+ | Expr.Op(TOp.TupleFieldGet (tupInfo,n),ts,[x],_) when not (evalTupInfoIsStruct tupInfo) ->
let context = TupleGet (n,ts) :: context
recognise context x
@@ -366,12 +366,14 @@ let checkTS = function
/// explicit tuple-structure in expr
let rec uncheckedExprTS expr =
match expr with
- | Expr.Op(TOp.Tuple,_tys,args,_) -> TupleTS (List.map uncheckedExprTS args)
- | _ -> UnknownTS
+ | Expr.Op(TOp.Tuple tupInfo,_tys,args,_) when not (evalTupInfoIsStruct tupInfo) ->
+ TupleTS (List.map uncheckedExprTS args)
+ | _ ->
+ UnknownTS
let rec uncheckedTypeTS g ty =
- if isTupleTy g ty then
- let tys = destTupleTy g ty
+ if isRefTupleTy g ty then
+ let tys = destRefTupleTy g ty
TupleTS (List.map (uncheckedTypeTS g) tys)
else
UnknownTS
@@ -387,12 +389,12 @@ let rebuildTS g m ts vs =
| vs ,TupleTS tss ->
let xtys,vs = List.mapFold rebuild vs tss
let xs,tys = List.unzip xtys
- let x = mkTupled g m xs tys
- let ty = mkTupledTy g tys
+ let x = mkRefTupled g m xs tys
+ let ty = mkRefTupledTy g tys
(x,ty),vs
let (x,_ty),vs = rebuild vs ts
- if vs.Length <> 0 then internalError "rebuildTS: had more fringe vars than fringe. REPORT BUG" else ();
+ if vs.Length <> 0 then internalError "rebuildTS: had more fringe vars than fringe. REPORT BUG"
x
/// CallPattern is tuple-structure for each argument position.
@@ -505,8 +507,8 @@ let zipCallPatternArgTys m g (callPattern : TupleStructure list) (vss : Val list
// (a) (restricted) tuple-structure, and
// (b) type fringe for each arg position.
match ts with
- | TupleTS tss when isTupleTy g typ ->
- let tys = destTupleTy g typ
+ | TupleTS tss when isRefTupleTy g typ ->
+ let tys = destRefTupleTy g typ
let tss,tyfringe = zipTSListTypList tss tys
TupleTS tss,tyfringe
| _ ->
@@ -674,7 +676,7 @@ let buildProjections env bindings x xtys =
xtys
|> List.mapi (fun i xty ->
let vi,vix = newLocalN env i xty
- let bind = mkBind NoSequencePointAtInvisibleBinding vi (mkTupleFieldGet (x,xtys,i,env.m))
+ let bind = mkBind NoSequencePointAtInvisibleBinding vi (mkTupleFieldGet env.eg (tupInfoRef,x,xtys,i,env.m))
bind,vix)
|> List.unzip
@@ -689,7 +691,7 @@ let rec collapseArg env bindings ts (x:Expr) =
| UnknownTS ,x ->
let bindings,vx = noEffectExpr env bindings x
bindings,[vx]
- | TupleTS tss,Expr.Op(TOp.Tuple,_xtys,xs,_) ->
+ | TupleTS tss,Expr.Op(TOp.Tuple tupInfo,_xtys,xs,_) when not (evalTupInfoIsStruct tupInfo) ->
let env = suffixE env "'"
collapseArgs env bindings 1 tss xs
| TupleTS tss,x ->
@@ -697,9 +699,9 @@ let rec collapseArg env bindings ts (x:Expr) =
let bindings,x = noEffectExpr env bindings x
let env = suffixE env "_p"
let xty = tyOfExpr env.eg x
- let xtys = destTupleTy env.eg xty
+ let xtys = destRefTupleTy env.eg xty
let bindings,xs = buildProjections env bindings x xtys
- collapseArg env bindings (TupleTS tss) (mkTupled env.eg m xs xtys)
+ collapseArg env bindings (TupleTS tss) (mkRefTupled env.eg m xs xtys)
and collapseArgs env bindings n (callPattern) args =
match callPattern,args with
@@ -759,7 +761,7 @@ let transRebind ybi xi =
match xi,ybi with
| _ ,SameArg -> [] (* no rebinding, reused original formal *)
| [u],NewArgs (_vs,x) -> [mkCompGenBind u x]
- | us ,NewArgs (_vs,x) -> List.map2 mkCompGenBind us (tryDestTuple x)
+ | us ,NewArgs (_vs,x) -> List.map2 mkCompGenBind us (tryDestRefTupleExpr x)
//-------------------------------------------------------------------------
@@ -794,7 +796,7 @@ let passBind penv (TBind(fOrig,repr,letSeqPtOpt) as bind) =
// fCBody - parts - formals
let transformedFormals = trans.transformedFormals
let p = transformedFormals.Length
- if (vss.Length < p) then internalError "passBinds: |vss|' in F#"
412,chkErrorUseOfByref,"A type instantiation involves a byref type. This is not permitted by the rules of Common IL."
413,chkErrorContainsCallToRethrow,"Calls to 'reraise' may only occur directly in a handler of a try-with"
@@ -334,6 +335,7 @@ csGenericConstructRequiresPublicDefaultConstructor,"A generic construct requires
492,csMethodIsNotAStaticMethod,"%s is not a static method"
493,csMethodIsNotAnInstanceMethod,"%s is not an instance method"
csMemberHasNoArgumentOrReturnProperty,"The member or object constructor '%s' has no argument or settable return property '%s'. %s."
+csCtorHasNoArgumentOrReturnProperty,"The object constructor '%s' has no argument or settable return property '%s'. %s. %s"
495,csRequiredSignatureIs,"The required signature is %s"
496,csMemberSignatureMismatch,"The member or object constructor '%s' requires %d argument(s). The required signature is '%s'."
497,csMemberSignatureMismatch2,"The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'."
@@ -342,7 +344,7 @@ csMemberHasNoArgumentOrReturnProperty,"The member or object constructor '%s' has
500,csMemberSignatureMismatchArityNamed,"The member or object constructor '%s' requires %d argument(s) but is here given %d unnamed and %d named argument(s). The required signature is '%s'."
501,csMemberSignatureMismatchArity,"The member or object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'."
502,csMemberSignatureMismatchArityType,"The member or object constructor '%s' takes %d type argument(s) but is here given %d. The required signature is '%s'."
-503,csMemberNotAccessible,"The member or object constructor '%s' taking %d arguments are not accessible from this code location. All accessible versions of method '%s' take %d arguments."
+503,csMemberNotAccessible,"A member or object constructor '%s' taking %d arguments is not accessible from this code location. All accessible versions of method '%s' take %d arguments."
504,csIncorrectGenericInstantiation,"Incorrect generic instantiation. No %s member named '%s' takes %d generic arguments."
505,csMemberOverloadArityMismatch,"The member or object constructor '%s' does not take %d argument(s). An overload was found taking %d arguments."
506,csNoMemberTakesTheseArguments,"No %s member or object constructor named '%s' takes %d arguments"
@@ -464,7 +466,7 @@ tcUnexpectedConstByteArray,"Unexpected Const_bytearray"
641,tcReturnValuesCannotHaveNames,"Return values cannot have names"
tcMemberKindPropertyGetSetNotExpected,"MemberKind.PropertyGetSet only expected in parse trees"
201,tcNamespaceCannotContainValues,"Namespaces cannot contain values. Consider using a module to hold your value declarations."
-644,tcNamespaceCannotContainExtensionMembers,"Namespaces cannot contain extension members except in the same file and namespace where the type is defined. Consider using a module to hold declarations of extension members."
+644,tcNamespaceCannotContainExtensionMembers,"Namespaces cannot contain extension members except in the same file and namespace declaration group where the type is defined. Consider using a module to hold declarations of extension members."
645,tcMultipleVisibilityAttributes,"Multiple visibility attributes have been specified for this identifier"
646,tcMultipleVisibilityAttributesWithLet,"Multiple visibility attributes have been specified for this identifier. 'let' bindings in classes are always private, as are any 'let' bindings inside expressions."
tcInvalidMethodNameForRelationalOperator,"The name '(%s)' should not be used as a member name. To define comparison semantics for a type, implement the 'System.IComparable' interface. If defining a static member for use from other CLI languages then use the name '%s' instead."
@@ -589,9 +591,10 @@ tcExpressionWithIfRequiresParenthesis,"This list or array expression includes an
764,tcFieldRequiresAssignment,"No assignment given for field '%s' of type '%s'"
765,tcExtraneousFieldsGivenValues,"Extraneous fields have been given values"
766,tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual,"Only overrides of abstract and virtual members may be specified in object expressions"
-767,tcNoAbstractOrVirtualMemberFound,"The member '%s' does not correspond to any abstract or virtual method available to override or implement"
-768,tcArgumentArityMismatch,"The member '%s' does not accept the correct number of arguments, %d arguments are expected"
-769,tcArgumentArityMismatchOneOverload,"The member '%s' does not accept the correct number of arguments. One overload accepts %d arguments."
+767,tcNoAbstractOrVirtualMemberFound,"The member '%s' does not correspond to any abstract or virtual method available to override or implement.%s"
+767,tcMemberFoundIsNotAbstractOrVirtual,"The type %s contains the member '%s' but it is not a virtual or abstract method that is available to override or implement.%s"
+768,tcArgumentArityMismatch,"The member '%s' does not accept the correct number of arguments. %d argument(s) are expected, but %d were given. The required signature is '%s'.%s"
+769,tcArgumentArityMismatchOneOverload,"The member '%s' does not accept the correct number of arguments. One overload accepts %d arguments, but %d were given. The required signature is '%s'.%s"
770,tcSimpleMethodNameRequired,"A simple method name is required here"
771,tcPredefinedTypeCannotBeUsedAsSuperType,"The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class"
772,tcNewMustBeUsedWithNamedType,"'new' must be used with a named type"
@@ -715,6 +718,7 @@ tcUnnamedArgumentsDoNotFormPrefix,"The unnamed arguments do not form a prefix of
893,tcOpenUsedWithPartiallyQualifiedPath,"This declaration opens the namespace or module '%s' through a partially qualified path. Adjust this code to use the full path of the namespace. This change will make your code more robust as new constructs are added to the F# and CLI libraries."
894,tcLocalClassBindingsCannotBeInline,"Local class bindings cannot be marked inline. Consider lifting the definition out of the class or else do not mark it as inline."
895,tcTypeAbbreviationsMayNotHaveMembers,"Type abbreviations cannot have members"
+tcTypeAbbreviationsCheckedAtCompileTime,"As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors."
896,tcEnumerationsMayNotHaveMembers,"Enumerations cannot have members"
897,tcMeasureDeclarationsRequireStaticMembers,"Measure declarations may have only static members"
tcStructsMayNotContainDoBindings,"Structs cannot contain 'do' bindings because the default constructor for structs would not execute these bindings"
@@ -835,7 +839,7 @@ optsNowin32manifest,"Do not include the default Win32 manifest"
optsResource,"Embed the specified managed resource"
optsLinkresource,"Link the specified resource to this assembly where the resinfo format is [,[,public|private]]"
optsDebugPM,"Emit debug information (Short form: -g)"
-optsDebug,"Specify debugging type: full, portable, pdbonly. ('full' is the default and enables attaching a debugger to a running program. 'portable' is a cross-platform format)."
+optsDebug,"Specify debugging type: full, portable, pdbonly. ('%s' is the default if no debuggging type specified and enables attaching a debugger to a running program. 'portable' is a cross-platform format)."
optsOptimize,"Enable optimizations (Short form: -O)"
optsTailcalls,"Enable or disable tailcalls"
optsCrossoptimize,"Enable or disable cross-module optimizations"
@@ -956,7 +960,6 @@ lexfltSeparatorTokensOfPatternMatchMisaligned,"The '|' tokens separating rules o
1126,nrGlobalUsedOnlyAsFirstName,"'global' may only be used as the first name in a qualified path"
1127,nrIsNotConstructorOrLiteral,"This is not a constructor or literal, or a constructor is being used incorrectly"
1128,nrUnexpectedEmptyLongId,"Unexpected empty long identifier"
-1129,nrTypeDoesNotContainSuchField,"The type '%s' does not contain a field '%s'"
1129,nrRecordDoesNotContainSuchLabel,"The record type '%s' does not contain a label '%s'."
1130,nrInvalidFieldLabel,"Invalid field label"
1132,nrInvalidExpression,"Invalid expression '%s'"
@@ -986,7 +989,7 @@ lexUnexpectedChar,"Unexpected character '%s'"
1153,lexInvalidFloat,"Invalid floating point number"
1154,lexOusideDecimal,"This number is outside the allowable range for decimal literals"
1155,lexOusideThirtyTwoBitFloat,"This number is outside the allowable range for 32-bit floats"
-1156,lexInvalidNumericLiteral,"This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1ui (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger)."
+1156,lexInvalidNumericLiteral,"This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger)."
1157,lexInvalidByteLiteral,"This is not a valid byte literal"
1158,lexInvalidCharLiteral,"This is not a valid character literal"
1159,lexThisUnicodeOnlyInStringLiterals,"This Unicode encoding is only valid in string literals"
@@ -1061,10 +1064,10 @@ lexIndentOffForML,"Consider using a file with extension '.ml' or '.mli' instead"
1220,chkNoReflectedDefinitionOnStructMember,"ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter"
1221,tcDllImportNotAllowed,"DLLImport bindings must be static members in a class or function definitions in a module"
1222,buildExplicitCoreLibRequiresNoFramework,"When mscorlib.dll or FSharp.Core.dll is explicitly referenced the %s option must also be passed"
-1223,buildExpectedSigdataFile,"FSharp.Core.sigdata not found alongside FSharp.Core"
-1224,buildDidNotExpectOptDataResource,"Did not expect to find optdata resource in FSharp.Core.dll"
-1225,buildExpectedFileAlongSideFSharpCore,"File '%s' not found alongside FSharp.Core"
-1226,buildDidNotExpectSigdataResource,"Did not expect to find sigdata resource in FSharp.Core.dll"
+1223,buildExpectedSigdataFile,"FSharp.Core.sigdata not found alongside FSharp.Core. File expected in %s."
+1224,buildDidNotExpectOptDataResource,"Did not expect to find optdata resource in FSharp.Core.dll at %s."
+1225,buildExpectedFileAlongSideFSharpCore,"File '%s' not found alongside FSharp.Core. File expected in %s."
+1226,buildDidNotExpectSigdataResource,"Did not expect to find sigdata resource in FSharp.Core.dll at %s."
1227,buildUnexpectedFileNameCharacter,"Filename '%s' contains invalid character '%s'"
1228,tcInvalidUseBangBinding,"'use!' bindings must be of the form 'use! = '"
1230,crefNoInnerGenericsInQuotations,"Inner generic functions are not permitted in quoted expressions. Consider adding some type constraints until this function is no longer generic."
@@ -1302,6 +1305,7 @@ estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetS
3194,optsResponseFileNotFound,"Response file '%s' not found in '%s'"
3195,optsResponseFileNameInvalid,"Response file name '%s' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long"
3196,fsharpCoreNotFoundToBeCopied,"Cannot find FSharp.Core.dll in compiler's directory"
+tcTupleStructMismatch,"One tuple type is a struct tuple, the other is a reference tuple"
3197,etMissingStaticArgumentsToMethod,"This provided method requires static parameters"
3198,considerUpcast,"The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using 'upcast' instead of 'downcast'."
3198,considerUpcastOperator,"The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using the :> (upcast) operator instead of the :?> (downcast) operator."
@@ -1310,8 +1314,8 @@ estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetS
3201,tcModuleAbbrevFirstInMutRec,"In a recursive declaration group, module abbreviations must come after all 'open' declarations and before other declarations"
3202,tcUnsupportedMutRecDecl,"This declaration is not supported in recursive declaration groups"
3203,parsInvalidUseOfRec,"Invalid use of 'rec' keyword"
-3204,tcStructUnionMultiCase,"A union type which is a struct must have only one case."
-3205,tcUseMayNotBeMutable,"This feature is deprecated. A 'use' binding may not be marked 'mutable'."
+3204,tcStructUnionMultiCaseDistinctFields,"If a union type has more than one case and is a struct, then all fields within the union type must be given unique names."
3206,CallerMemberNameIsOverriden,"The CallerMemberNameAttribute applied to parameter '%s' will have no effect. It is overridden by the CallerFilePathAttribute."
3207,tcFixedNotAllowed,"Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string'"
3208,tcCouldNotFindOffsetToStringData,"Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression."
+3209,chkNoByrefReturnOfLocal,"The address of the variable '%s' cannot be used at this point. A method or function may not return the address of this local value."
diff --git a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj
index d8db6885063..d2b034ccb39 100644
--- a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj
+++ b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj
@@ -47,11 +47,18 @@
-
-
-
-
-
+
+ $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll
+
+
+ $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll
+
+
+ $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll
+
+
+ $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll
+