Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f4bd221
use proto on mac and linux
dsyme Mar 29, 2019
8a4baf3
reduce diff
dsyme Mar 30, 2019
0474a23
reduce diff
dsyme Mar 30, 2019
b96120e
reduce diff
dsyme Mar 30, 2019
cf9147b
reduce diff
dsyme Mar 30, 2019
286c336
reduce diff
dsyme Mar 30, 2019
7a6448e
reduce diff
dsyme Mar 30, 2019
965d3b1
Merge branch 'master' of https://github.com/Microsoft/visualfsharp in…
dsyme Apr 2, 2019
978414c
Merge branch 'master' into proto
KevinRansom Apr 8, 2019
95d94de
integrate master
dsyme Apr 14, 2019
a15ef59
integrate master
dsyme Apr 14, 2019
aed6752
fix build
dsyme Apr 14, 2019
bb78e5f
fix build
dsyme Apr 14, 2019
b88d23c
Merge branch 'fix77' into proto
dsyme Apr 14, 2019
1aa6a41
load right FSHarp.Build
dsyme Apr 15, 2019
058bdc9
publish proto apps
dsyme Apr 15, 2019
688850f
revert test env changes
dsyme Apr 15, 2019
c2c7213
revert testing changes
dsyme Apr 16, 2019
fdcf82a
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Apr 16, 2019
e46dcd5
don't repeat bootstrap
dsyme Apr 16, 2019
75e9cc3
be systematic about verbosity
dsyme Apr 17, 2019
d0f51d7
Merge branch 'proto' of https://github.com/dsyme/visualfsharp into proto
dsyme Apr 17, 2019
63c64ef
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Apr 18, 2019
8f09004
remove verbosity flags
dsyme Apr 24, 2019
5833f0c
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme May 31, 2019
d96345d
fix compiler location (#6917)
KevinRansom Jun 2, 2019
7c39a4f
Remove dead code in Extensions and Pervasive files (#6916)
cartermp Jun 2, 2019
2d7237c
No IVTs for CodeLenses (#6906)
cartermp Jun 2, 2019
e4707c5
Open Implement Interface APIs (#6905)
cartermp Jun 2, 2019
3a3d6ed
Replace AgedLookup with Dictionary in XML doc generation and remove d…
cartermp Jun 2, 2019
b91fa8b
Attributes lists (#6830)
auduchinok Jun 2, 2019
c036b35
Make FSharpAccessibility.IsProtected public, optimize IsPublic proper…
auduchinok Jun 2, 2019
ad5f69e
Replace SynSimplePat list with SynSimplePats in ImplicitCtor (#6845)
auduchinok Jun 2, 2019
45fed83
Reconfigure Legacy MSBuildReferenceResolver to be API-driven (#6898)
cartermp Jun 2, 2019
57969f6
Remove IVT to FSharp.Editor (#6930)
cartermp Jun 2, 2019
d12a626
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Jun 3, 2019
1632239
try align with fsc.fsproj
dsyme Jun 3, 2019
14be767
Don't go looking for MSBuild v12 in SimulatedMSBuildReferenceResolver…
cartermp Jun 3, 2019
a8eb9b1
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Jun 4, 2019
52e0844
try to fix build
dsyme Jun 4, 2019
c96481f
Merge pull request #6380 from dsyme/proto
dsyme Jun 4, 2019
6d989fa
ensure Microsoft.FSharp.NetSdk.props makes it into VisualFSharpFull.v…
brettfo Jun 5, 2019
f72b7b2
split service.fs (#6247)
dsyme Jun 6, 2019
b101514
Update DEVGUIDE.md (#6950)
ShalokShalom Jun 6, 2019
e835edf
Update repo name (#6951)
ShalokShalom Jun 7, 2019
49082d3
Removing CONTRIBUTING.md (#6958)
cartermp Jun 10, 2019
832f2c0
Remove IVT to FSharp.Build (#6970)
cartermp Jun 11, 2019
8e0565f
Don't stop type checking recursive module on unresolved open (#6965)
auduchinok Jun 11, 2019
e556508
Remove IVT to fsi from FSharp.Compiler.Private (#6957)
cartermp Jun 11, 2019
a4cbfe1
enable preview LSP support in VS (#6945)
brettfo Jun 11, 2019
027e8c9
fixed List.map3 misleading error message on different length lists (#…
reacheight Jun 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace SynSimplePat list with SynSimplePats in ImplicitCtor (#6845)
* Replace SynSimplePat list with SynSimplePats in ImplicitCtor

* Use SynSimplePats in SynTypeDefnSimpleRepr.General during type check
  • Loading branch information
auduchinok authored and KevinRansom committed Jun 2, 2019
commit ad5f69e41a45b23e348e1836b1a8496c857381eb
10 changes: 5 additions & 5 deletions src/fsharp/TypeChecker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13556,7 +13556,7 @@ module MutRecBindingChecking =
error(Error(FSComp.SR.tcEnumerationsMayNotHaveMembers(), (trimRangeToLine m)))

match classMemberDef, containerInfo with
| SynMemberDefn.ImplicitCtor (vis, Attributes attrs, spats, thisIdOpt, m), ContainerInfo(_, Some(MemberOrValContainerInfo(tcref, _, baseValOpt, safeInitInfo, _))) ->
| SynMemberDefn.ImplicitCtor (vis, Attributes attrs, SynSimplePats.SimplePats(spats, _), thisIdOpt, m), ContainerInfo(_, Some(MemberOrValContainerInfo(tcref, _, baseValOpt, safeInitInfo, _))) ->
if tcref.TypeOrMeasureKind = TyparKind.Measure then
error(Error(FSComp.SR.tcMeasureDeclarationsRequireStaticMembers(), m))

Expand Down Expand Up @@ -15016,7 +15016,7 @@ module EstablishTypeDefinitionCores =
match implicitCtorSynPats with
| None -> ()
| Some spats ->
let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true NoCheckCxs env tpenv (SynSimplePats.SimplePats (spats, m))
let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true NoCheckCxs env tpenv spats
for arg in ctorArgNames do
let ty = names.[arg].Type
let m = names.[arg].Ident.idRange
Expand Down Expand Up @@ -15816,7 +15816,7 @@ module EstablishTypeDefinitionCores =
()
| Some spats ->
if tycon.IsFSharpStructOrEnumTycon then
let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true CheckCxs envinner tpenv (SynSimplePats.SimplePats (spats, m))
let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true CheckCxs envinner tpenv spats
for arg in ctorArgNames do
let ty = names.[arg].Type
let id = names.[arg].Ident
Expand Down Expand Up @@ -16621,7 +16621,7 @@ module TcDeclarations =

let implicitCtorSynPats =
members |> List.tryPick (function
| SynMemberDefn.ImplicitCtor (_, _, spats, _, _) -> Some spats
| SynMemberDefn.ImplicitCtor (_, _, (SynSimplePats.SimplePats _ as spats), _, _) -> Some spats
| _ -> None)

// An ugly bit of code to pre-determine if a type has a nullary constructor, prior to establishing the
Expand All @@ -16630,7 +16630,7 @@ module TcDeclarations =
members |> List.exists (function
| SynMemberDefn.Member(Binding(_, _, _, _, _, _, SynValData(Some memberFlags, _, _), SynPatForConstructorDecl SynPatForNullaryArgs, _, _, _, _), _) ->
memberFlags.MemberKind=MemberKind.Constructor
| SynMemberDefn.ImplicitCtor (_, _, spats, _, _) -> isNil spats
| SynMemberDefn.ImplicitCtor (_, _, SynSimplePats.SimplePats(spats, _), _, _) -> isNil spats
| _ -> false)
let repr = SynTypeDefnSimpleRepr.General(kind, inherits, slotsigs, fields, isConcrete, isIncrClass, implicitCtorSynPats, m)
let isAtOriginalTyconDefn = not (isAugmentationTyconDefnRepr repr)
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/ast.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ and

/// An object oriented type definition. This is not a parse-tree form, but represents the core
/// type representation which the type checker splits out from the "ObjectModel" cases of type definitions.
| General of SynTypeDefnKind * (SynType * range * Ident option) list * (SynValSig * MemberFlags) list * SynField list * bool * bool * SynSimplePat list option * range: range
| General of SynTypeDefnKind * (SynType * range * Ident option) list * (SynValSig * MemberFlags) list * SynField list * bool * bool * SynSimplePats option * range: range

/// A type defined by using an IL assembly representation. Only used in FSharp.Core.
///
Expand Down Expand Up @@ -1525,7 +1525,7 @@ and
| Member of memberDefn: SynBinding * range: range

/// implicit ctor args as a defn line, 'as' specification
| ImplicitCtor of accessiblity: SynAccess option * attributes: SynAttributes * ctorArgs: SynSimplePat list * selfIdentifier: Ident option * range: range
| ImplicitCtor of accessiblity: SynAccess option * attributes: SynAttributes * ctorArgs: SynSimplePats * selfIdentifier: Ident option * range: range

/// inherit <typ>(args...) as base
| ImplicitInherit of inheritType: SynType * inheritArgs: SynExpr * inheritAlias: Ident option * range: range
Expand Down
63 changes: 38 additions & 25 deletions src/fsharp/pars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -2735,38 +2735,51 @@ bindingPattern:
{ let xmlDoc = grabXmlDoc(parseState,1)
mkSynBinding (xmlDoc,$1), rhs parseState 1 }

/* sp = v | sp:typ | attrs sp */
// Subset of patterns allowed to be used in implicit ctors.
// For a better error recovery we could replace these rules with the actual SynPat parsing
// and use allowed patterns only at a later analysis stage reporting errors along the way.
simplePattern:
| ident
{ SynSimplePat.Id ($1,None,false,false,false,rhs parseState 1) }
| QMARK ident
{ SynSimplePat.Id ($2,None,false,false,true,rhs parseState 2) }
| ident
{ let m = rhs parseState 1
SynPat.Named(SynPat.Wild m, $1, false, None, m) }
| QMARK ident
{ SynPat.OptionalVal($2, rhs parseState 2) }
| simplePattern COLON typeWithTypeConstraints
{ let lhsm = lhs parseState
SynSimplePat.Typed($1,$3,lhsm) }
{ SynPat.Typed($1, $3, lhs parseState) }
| attributes simplePattern %prec paren_pat_attribs
{ let lhsm = lhs parseState
SynSimplePat.Attrib($2,$1,lhsm) }
{ SynPat.Attrib($2, $1, lhs parseState) }

simplePatternCommaList:
| simplePattern
{ [$1] }
| simplePattern COMMA simplePatternCommaList
{ $1 :: $3 }
| simplePattern
{ $1 }
| simplePattern COMMA simplePatternCommaList
{ match $3 with
| SynPat.Tuple(_, pats, _) -> SynPat.Tuple(false, $1 :: pats, rhs2 parseState 1 3)
| _ -> SynPat.Tuple(false, [$1; $3], rhs2 parseState 1 3) }

simplePatterns:
| LPAREN simplePatternCommaList rparen
{ $2 }
| LPAREN rparen
{ [] }
| LPAREN simplePatternCommaList recover
{ reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen())
[] }
| LPAREN error rparen
{ (* silent recovery *) [] }
| LPAREN recover
{ reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen())
[] }
| LPAREN simplePatternCommaList rparen
{ let parenPat = SynPat.Paren($2, rhs2 parseState 1 3)
let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator parenPat
simplePats }
| LPAREN rparen
{ let pat = SynPat.Const(SynConst.Unit, rhs2 parseState 1 2)
let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator pat
simplePats }
| LPAREN simplePatternCommaList recover
{ reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen())
let parenPat = SynPat.Paren(SynPat.Tuple(false, [], rhs2 parseState 1 2), rhs2 parseState 1 2) // todo: report parsed pats anyway?
let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator parenPat
simplePats }
| LPAREN error rparen
{ let parenPat = SynPat.Paren(SynPat.Wild(rhs parseState 2), rhs2 parseState 1 3) // silent recovery
let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator parenPat
simplePats }
| LPAREN recover
{ reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen())
let pat = SynPat.Wild(lhs parseState)
let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator pat
simplePats }


headBindingPattern:
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/service/ServiceAssemblyContent.fs
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,9 @@ module ParsedInput =
and walkMember = function
| SynMemberDefn.AbstractSlot (valSig, _, _) -> walkValSig valSig
| SynMemberDefn.Member (binding, _) -> walkBinding binding
| SynMemberDefn.ImplicitCtor (_, Attributes attrs, pats, _, _) ->
| SynMemberDefn.ImplicitCtor (_, Attributes attrs, SynSimplePats.SimplePats(simplePats, _), _, _) ->
List.iter walkAttribute attrs
List.iter walkSimplePat pats
List.iter walkSimplePat simplePats
| SynMemberDefn.ImplicitInherit (t, e, _, _) -> walkType t; walkExpr e
| SynMemberDefn.LetBindings (bindings, _, _, _) -> List.iter walkBinding bindings
| SynMemberDefn.Interface (t, members, _) ->
Expand Down
6 changes: 4 additions & 2 deletions src/fsharp/service/ServiceParseTreeWalk.fs
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,10 @@ module public AstTraversal =
match m with
| SynMemberDefn.Open(_longIdent, _range) -> None
| SynMemberDefn.Member(synBinding, _range) -> traverseSynBinding path synBinding
| SynMemberDefn.ImplicitCtor(_synAccessOption, _synAttributes, synSimplePatList, _identOption, _range) ->
visitor.VisitSimplePats(synSimplePatList)
| SynMemberDefn.ImplicitCtor(_synAccessOption, _synAttributes, simplePats, _identOption, _range) ->
match simplePats with
| SynSimplePats.SimplePats(simplePats, _) -> visitor.VisitSimplePats(simplePats)
| _ -> None
| SynMemberDefn.ImplicitInherit(synType, synExpr, _identOption, range) ->
[
dive () synType.Range (fun () ->
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/service/ServiceUntypedParse.fs
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,8 @@ module UntypedParseImpl =
and walkMember = function
| SynMemberDefn.AbstractSlot (valSig, _, _) -> walkValSig valSig
| SynMemberDefn.Member(binding, _) -> walkBinding binding
| SynMemberDefn.ImplicitCtor(_, Attributes attrs, pats, _, _) ->
List.tryPick walkAttribute attrs |> Option.orElse (List.tryPick walkSimplePat pats)
| SynMemberDefn.ImplicitCtor(_, Attributes attrs, SynSimplePats.SimplePats(simplePats, _), _, _) ->
List.tryPick walkAttribute attrs |> Option.orElse (List.tryPick walkSimplePat simplePats)
| SynMemberDefn.ImplicitInherit(t, e, _, _) -> walkType t |> Option.orElse (walkExpr e)
| SynMemberDefn.LetBindings(bindings, _, _, _) -> List.tryPick walkBinding bindings
| SynMemberDefn.Interface(t, members, _) ->
Expand Down