File: comment_inherited_class.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (51 lines) | stat: -rw-r--r-- 4,048 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// RUN: %target-swift-ide-test -print-comments -source-filename %s | %FileCheck %s
// REQUIRES: no_asan

class Base {
  func noComments() {}
  // CHECK: Func/Base.noComments {{.*}} DocCommentAsXML=none

  /// Base
  func funcNoDerivedComment() {}
  // CHECK: Func/Base.funcNoDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcNoDerivedComment()</Name><USR>s:14swift_ide_test4BaseC20funcNoDerivedCommentyyF</USR><Declaration>func funcNoDerivedComment()</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Function>]

  /// Base
  func funcWithDerivedComment() {}
  // CHECK: Func/Base.funcWithDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcWithDerivedComment()</Name><USR>s:14swift_ide_test4BaseC22funcWithDerivedCommentyyF</USR><Declaration>func funcWithDerivedComment()</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Function>]

  /// Base
  var varNoDerivedComment: Bool {
    return false
  }
  // CHECK: Var/Base.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test4BaseC19varNoDerivedCommentSbvp</USR><Declaration>var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]

  /// Base
  var varWithDerivedComment: Bool {
    return false
  }
  // CHECK: Var/Base.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test4BaseC21varWithDerivedCommentSbvp</USR><Declaration>var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]
}

class Derived : Base {
  override func noComments() {}
  // CHECK: Func/Derived.noComments {{.*}} DocCommentAsXML=none

  override func funcNoDerivedComment() {}
  // CHECK: Func/Derived.funcNoDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcNoDerivedComment()</Name><USR>s:14swift_ide_test7DerivedC06funcNoD7CommentyyF</USR><Declaration>override func funcNoDerivedComment()</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Function>]

  /// Derived
  override func funcWithDerivedComment() {}
  // CHECK: Func/Derived.funcWithDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcWithDerivedComment()</Name><USR>s:14swift_ide_test7DerivedC08funcWithD7CommentyyF</USR><Declaration>override func funcWithDerivedComment()</Declaration><CommentParts><Abstract><Para>Derived</Para></Abstract></CommentParts></Function>]

  override var varNoDerivedComment: Bool {
    return false
  }
  // CHECK: Var/Derived.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test7DerivedC05varNoD7CommentSbvp</USR><Declaration>override var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]

  // Derived
  override var varWithDerivedComment : Bool {
    return true
  }
  // CHECK: Var/Derived.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test7DerivedC07varWithD7CommentSbvp</USR><Declaration>override var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]
}