Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 1 addition & 12 deletions src/Compiler/Checking/PostInferenceChecks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ type env =
/// "module remap info", i.e. hiding information down the signature chain, used to compute what's hidden by a signature
sigToImplRemapInfo: (Remap * SignatureHidingInfo) list

/// Constructor limited - are we in the prelude of a constructor, prior to object initialization
ctorLimitedZone: bool

/// Are we in a quotation?
quote : bool

Expand Down Expand Up @@ -1143,7 +1140,7 @@ and CheckExpr (cenv: cenv) (env: env) origExpr (ctxt: PermitByRefExpr) : Limit =

| Expr.Sequential (e1, e2, ThenDoSeq, _) ->
CheckExprNoByrefs cenv env e1
CheckExprNoByrefs cenv {env with ctorLimitedZone=false} e2
CheckExprNoByrefs cenv env e2
NoLimit

| Expr.Const (_, m, ty) ->
Expand Down Expand Up @@ -1425,9 +1422,6 @@ and CheckNoResumableStmtConstructs cenv _env expr =
and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr =
let g = cenv.g

let ctorLimitedZoneCheck() =
if env.ctorLimitedZone then errorR(Error(FSComp.SR.chkObjCtorsCantUseExceptionHandling(), m))

// Ensure anonymous record type requirements are recorded
match op with
| TOp.AnonRecdGet (anonInfo, _)
Expand All @@ -1444,7 +1438,6 @@ and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr =

| TOp.TryFinally _, [_], [Expr.Lambda (_, _, _, [_], e1, _, _); Expr.Lambda (_, _, _, [_], e2, _, _)] ->
CheckTypeInstNoInnerByrefs cenv env m tyargs // result of a try/finally can be a byref
ctorLimitedZoneCheck()
let limit = CheckExpr cenv env e1 ctxt // result of a try/finally can be a byref if in a position where the overall expression is can be a byref
CheckExprNoByrefs cenv env e2
limit
Expand All @@ -1455,7 +1448,6 @@ and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr =

| TOp.TryWith _, [_], [Expr.Lambda (_, _, _, [_], e1, _, _); Expr.Lambda (_, _, _, [_], _e2, _, _); Expr.Lambda (_, _, _, [_], e3, _, _)] ->
CheckTypeInstNoInnerByrefs cenv env m tyargs // result of a try/catch can be a byref
ctorLimitedZoneCheck()
let limit1 = CheckExpr cenv env e1 ctxt // result of a try/catch can be a byref if in a position where the overall expression is can be a byref
// [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3]
let limit2 = CheckExpr cenv env e3 ctxt // result of a try/catch can be a byref if in a position where the overall expression is can be a byref
Expand Down Expand Up @@ -2010,8 +2002,6 @@ and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bin
let access = AdjustAccess (IsHiddenVal env.sigToImplRemapInfo v) (fun () -> v.DeclaringEntity.CompilationPath) v.Accessibility
CheckTypeForAccess cenv env (fun () -> NicePrint.stringOfQualifiedValOrMember cenv.denv cenv.infoReader vref) access v.Range v.Type

let env = if v.IsConstructor && not v.IsIncrClassConstructor then { env with ctorLimitedZone=true } else env

if cenv.reportErrors then

// Check top-level let-bound values
Expand Down Expand Up @@ -2643,7 +2633,6 @@ let CheckImplFile (g, amap, reportErrors, infoReader, internalsVisibleToPaths, v
let env =
{ sigToImplRemapInfo=[]
quote=false
ctorLimitedZone=false
boundTyparNames=[]
argVals = ValMap.Empty
boundTypars= TyparMap.Empty
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ chkVariableUsedInInvalidWay,"The variable '%s' is used in an invalid way"
417,chkNoFirstClassRethrow,"First-class uses of the 'reraise' function is not permitted"
418,chkNoByrefAtThisPoint,"The byref typed value '%s' cannot be used at this point"
419,chkLimitationsOfBaseKeyword,"'base' values may only be used to make direct calls to the base implementations of overridden members"
420,chkObjCtorsCantUseExceptionHandling,"Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL."
#420,chkObjCtorsCantUseExceptionHandling,"Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL."
421,chkNoAddressOfAtThisPoint,"The address of the variable '%s' cannot be used at this point"
422,chkNoAddressStaticFieldAtThisPoint,"The address of the static field '%s' cannot be used at this point"
423,chkNoAddressFieldAtThisPoint,"The address of the field '%s' cannot be used at this point"
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">Hodnoty base se dají použít jenom k přímému volání implementací base přepsaných členů.</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">Konstruktory objektu nemůžou použít try/with a try/finally přímo, dokud se objekt neinicializuje. To zahrnuje i konstrukce, jako je třeba for x in ..., které se dají na použití těchto konstruktorů rozpracovat. Toto je omezení mezijazyka Common IL.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">Adresa proměnné {0} se na tomto místě použít nedá.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">base-Werte dürfen nur für direkte Aufrufe der Basisimplementierungen von überschriebenen Membern verwendet werden.</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">Objektkonstruktoren dürfen "try/with" und "try/finally" vor der Initialisierung des Objekts nicht direkt verwenden. Dies umfasst Konstrukte wie "for x in ...", bei denen diese Konstrukte u.U. verwendet werden. Dies ist eine Einschränkung der Common IL.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">Die Adresse der Variablen "{0}" kann an diesem Punkt nicht verwendet werden.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">Los valores 'base' se pueden usar solo para realizar llamadas directas a las implementaciones base de miembros invalidados.</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">Los constructores de objetos no pueden usar directamente try/with y try/finally antes de la inicialización del objeto. Esto incluye constructores como 'for x in ...' que pueden dar lugar a usos de estos constructores. Esta es una limitación impuesta por Common IL.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">La dirección de la variable '{0}' no se puede usar en este punto.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">Les valeurs 'base' ne peuvent être utilisées que pour effectuer des appels directs aux implémentations de base des membres substitués</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">Les constructeurs d'objets ne peuvent pas utiliser directement try/with et try/finally avant l'initialisation de l'objet. Cela inclut les constructions telles que 'for x in ...' qui peuvent conduire aux utilisations de ces constructions. Il s'agit d'une limitation imposée par le langage CIL (Common Intermediate Language).</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">Impossible d'utiliser l'adresse de la variable '{0}' actuellement</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">I valori 'base' possono essere utilizzati esclusivamente per effettuare chiamate dirette alle implementazioni di base dei membri sottoposti a override</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">I costruttori di oggetti non possono utilizzare direttamente try/with e try/finally prima dell'inizializzazione dell'oggetto. Ciò include costrutti quali 'for x in ...' che potrebbero essere elaborati negli utilizzi di tali costrutti. Si tratta di una limitazione imposta dall'IL comune.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">Non è possibile usare l'indirizzo della variabile '{0}' in questo punto</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">'base' 値を使用できるのは、オーバーライドされたメンバーの基本実装に対して直接呼び出しを行う場合のみです。</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">オブジェクト コンストラクターでは、オブジェクトの初期化前に try/with および try/finally を直接使用できません。'for x in ...' などのコストラクトを呼び出す可能性があるようなコンストラクトがこれに含まれます。これは Common IL での制限事項です。</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">この時点で変数 '{0}' のアドレスは使用できません</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">'base' 값은 재정의된 멤버의 기본 구현에 대한 직접 호출을 수행하는 데에만 사용할 수 있습니다.</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">개체 생성자는 개체 초기화 전에 try/with 및 try/finally를 직접 사용할 수 없습니다. 여기에는 이러한 구문의 사용을 자세히 설명할 수 있는 'for x in ...'과 같은 구문이 포함됩니다. 이는 공통 IL의 제한입니다.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">'{0}' 변수의 주소를 현재 사용할 수 없습니다.</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">Wartości „base” mogą być używane tylko w celu bezpośrednich wywołań, które dotyczą podstawowych implementacji przesłoniętych elementów członkowskich</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">Konstruktory obiektów nie mogą bezpośrednio używać instrukcji try/with i try/finally przed zainicjowaniem obiektu. Obejmuje to takie konstrukcje, jak „for x in ...”, które mogą skutkować użyciem takich konstrukcji. Jest to ograniczenie nałożone przez język Common IL.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">Nie można użyć adresu zmiennej „{0}” w tym momencie</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">Valores 'base' só podem ser usados para fazer chamadas diretas às implementações de base de membros substituídos</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">Construtores de objeto não podem usar try/with nem try/finally antes da inicialização do objeto. O que inclui construções como ' x in... ' que podem elaborar usos dessas construções. Esta é uma limitação imposta pelo IL Comum.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">O endereço da variável '{0}' não pode ser usado neste ponto</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">Значения "base" можно использовать только для выполнения прямых вызовов реализаций класса base для переопределенных элементов</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">В конструкторе объекта нельзя прямо использовать блоки try/with и try/finally до инициализации объекта. К таким вариантам использования также относятся и конструкции вида "for x in ...", применение которых может привести к использованию указанных конструкций. Это ограничение связано с требованиями общего промежуточного языка.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">В этой точке нельзя использовать адрес переменной "{0}"</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">'base' değerleri yalnızca geçersiz kılınmış üyelerin taban uygulamalarına doğrudan çağrı yapmak için kullanılabilir</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">Nesne oluşturucular, nesnenin başlatılmasından önce try/with ve try/finally ifadelerini doğrudan kullanamazlar. Buna bu yapıların kullanımını çeşitlendirebilen 'for x in ...' gibi yapılar da dahildir. Bu, Ortak Ara Dilin getirdiği bir kısıtlamadır.</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">'{0}' değişkeninin adresi bu noktada kullanılamaz</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">"base" 值只能用于直接调用重写成员的基实现</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">在初始化对象之前,对象构造函数不能直接使用 try/with 和 try/finally。这包括像 "for x in ..." 这样详细说明其构造使用方式的构造。这是由通用 IL 设定的限制。</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">此时无法使用变量“{0}”的地址</target>
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,6 @@
<target state="translated">'base' 值只能用來直接呼叫覆寫成員的基底實作</target>
<note />
</trans-unit>
<trans-unit id="chkObjCtorsCantUseExceptionHandling">
<source>Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL.</source>
<target state="translated">物件建構函式不能在物件初始化之前直接使用 try/with 和 try/finally。這包括 'for x in ...' 這類可以詳述這些建構用途的建構函式。這是 Common IL 的限制。</target>
<note />
</trans-unit>
<trans-unit id="chkNoAddressOfAtThisPoint">
<source>The address of the variable '{0}' cannot be used at this point</source>
<target state="translated">目前無法使用變數 '{0}' 的位址</target>
Expand Down
Loading