Skip to content
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

[Access Control] 誤訳修正、翻訳改善 #333

Merged
merged 6 commits into from
Aug 9, 2022
Merged

Conversation

t-ae
Copy link
Collaborator

@t-ae t-ae commented Aug 5, 2022

アクセスレベルの高低が逆になっているなどの誤訳があったので修正です。

@github-actions github-actions bot requested a review from stzn August 5, 2022 09:11

さらに、同じモジュールで定義されているクラスの場合、特定のアクセスレベルコンテキストでアクセス可能な任意のクラスのメンバ\(メソッド、プロパティ、イニシャライザ、またはサブスクリプト\)をオーバーライドできます。別のモジュールで定義されているクラスの場合、open クラスのメンバをオーバーライドできます
さらに、同じモジュールで定義されているクラスの場合、特定のアクセスコンテキストでアクセス可能な任意のクラスのメンバ\(メソッド、プロパティ、イニシャライザ、またはサブスクリプト\)をオーバーライドできます。別のモジュールで定義されているクラスの場合、そのクラスの open メンバをオーバーライドできます
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文ではaccess contextaccess level context が出てきて、ここでは access context です。
使い分けがよく分かりませんが、とりあえず出てくるものに合わせました。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。access contextはクラス同士の話をしていて、access level contextは内部のメンバ同士の話をしているのかなと思いましたが、いまいちわからないですねw


### プロトコル継承\(Protocol Inheritance\)

既存のプロトコルから継承する新しいプロトコルを定義する場合、新しいプロトコルは、継承元のプロトコルと同じアクセスレベルにしか設定できません。例えば、internal プロトコルから継承する public プロトコルを作成することはできません。

### プロトコル準拠\(Protocol Conformance\)

型は、型自体よりもアクセスレベルの厳しいプロトコルに準拠できます。例えば、他のモジュールで使用できる public 型を定義できますが、internal プロトコルへ準拠した実装は internal プロトコルの定義モジュール内でのみ使用できます。
型は、型自体よりもアクセスレベルの厳しいプロトコルに準拠できます。例えば、他のモジュールで使用できる public 型を定義できますが、internal プロトコルへの準拠は internal プロトコルの定義モジュール内でのみ使用できます。
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文 but whose conformance to an internal protocol can only be used within the internal protocol’s defining module.
準拠自体のアクセスレベルの話をしているようなので、プロトコルへ準拠した実装は は違うと思います。
ある型が InternalProtocol を実装しているとして、外部のモジュールからは InternalProtocol に準拠していることを認識できないというような意図ではないかと思っています。

Copy link
Owner

@stzn stzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!間違いの修正、すごい助かりますmm細かい点についていくつかコメントしました。

language-guide/access-control.md Outdated Show resolved Hide resolved
language-guide/access-control.md Outdated Show resolved Hide resolved
language-guide/access-control.md Outdated Show resolved Hide resolved
language-guide/access-control.md Outdated Show resolved Hide resolved

さらに、同じモジュールで定義されているクラスの場合、特定のアクセスレベルコンテキストでアクセス可能な任意のクラスのメンバ\(メソッド、プロパティ、イニシャライザ、またはサブスクリプト\)をオーバーライドできます。別のモジュールで定義されているクラスの場合、open クラスのメンバをオーバーライドできます
さらに、同じモジュールで定義されているクラスの場合、特定のアクセスコンテキストでアクセス可能な任意のクラスのメンバ\(メソッド、プロパティ、イニシャライザ、またはサブスクリプト\)をオーバーライドできます。別のモジュールで定義されているクラスの場合、そのクラスの open メンバをオーバーライドできます
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。access contextはクラス同士の話をしていて、access level contextは内部のメンバ同士の話をしているのかなと思いましたが、いまいちわからないですねw

t-ae and others added 4 commits August 6, 2022 08:24
Co-authored-by: shiz <35151927+stzn@users.noreply.github.com>
Co-authored-by: shiz <35151927+stzn@users.noreply.github.com>
Co-authored-by: shiz <35151927+stzn@users.noreply.github.com>
language-guide/access-control.md Outdated Show resolved Hide resolved
Copy link
Owner

@stzn stzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです👍🏻ありがとうございます!

@stzn stzn merged commit e9dce1d into stzn:master Aug 9, 2022
@t-ae t-ae deleted the access-control branch August 24, 2022 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants