Remove hidden modifier from many reflect properties for better equality/rendering (#470)

This commit is contained in:
Islon Scherer
2024-05-03 11:04:15 +02:00
committed by GitHub
parent b5208a2b5b
commit 27d8a030b1
3 changed files with 1748 additions and 5 deletions
File diff suppressed because it is too large Load Diff
@@ -79,6 +79,9 @@ abstract class AbstractLanguageSnippetTestsEngine : InputOutputTestEngine() {
// can't think of a better solution right now // can't think of a better solution right now
protected fun String.stripVersionCheckErrorMessage() = protected fun String.stripVersionCheckErrorMessage() =
replace("Pkl version is ${Release.current().version()}", "Pkl version is xxx") replace("Pkl version is ${Release.current().version()}", "Pkl version is xxx")
protected fun String.stripStdlibLocationSha(): String =
replace("https://github.com/apple/pkl/blob/${Release.current().commitId()}/stdlib/", "https://github.com/apple/pkl/blob/\$commitId/stdlib/")
} }
class LanguageSnippetTestsEngine : AbstractLanguageSnippetTestsEngine() { class LanguageSnippetTestsEngine : AbstractLanguageSnippetTestsEngine() {
@@ -142,7 +145,7 @@ class LanguageSnippetTestsEngine : AbstractLanguageSnippetTestsEngine() {
val stderr = logWriter.toString() val stderr = logWriter.toString()
return (success && stderr.isBlank()) to (output + stderr).stripFilePaths().stripWebsite() return (success && stderr.isBlank()) to (output + stderr).stripFilePaths().stripWebsite().stripStdlibLocationSha()
} }
} }
@@ -220,6 +223,7 @@ abstract class AbstractNativeLanguageSnippetTestsEngine : AbstractLanguageSnippe
.stripLineNumbers() .stripLineNumbers()
.stripWebsite() .stripWebsite()
.stripVersionCheckErrorMessage() .stripVersionCheckErrorMessage()
.stripStdlibLocationSha()
} finally { } finally {
process.destroy() process.destroy()
} }
+4 -4
View File
@@ -159,7 +159,7 @@ external const function TypeVariable(referent: TypeParameter): TypeVariable
/// A program declaration. /// A program declaration.
abstract external class Declaration { abstract external class Declaration {
/// The source location of this declaration. /// The source location of this declaration.
hidden location: SourceLocation location: SourceLocation
/// The documentation comment for this declaration, if any. /// The documentation comment for this declaration, if any.
docComment: String? docComment: String?
@@ -226,7 +226,7 @@ abstract external class TypeDeclaration extends Declaration {
/// A class declaration. /// A class declaration.
external class Class extends TypeDeclaration { external class Class extends TypeDeclaration {
/// The class reflected upon. /// The class reflected upon.
hidden reflectee: base.Class reflectee: base.Class
/// The type parameters of this class. /// The type parameters of this class.
/// ///
@@ -236,12 +236,12 @@ external class Class extends TypeDeclaration {
/// The superclass of this class. /// The superclass of this class.
/// ///
/// All classes except [Any] have a superclass. /// All classes except [Any] have a superclass.
hidden superclass: Class? superclass: Class?
/// The supertype of this class. /// The supertype of this class.
/// ///
/// All classes except [Any] have a supertype. /// All classes except [Any] have a supertype.
hidden supertype: Type? supertype: Type?
/// The properties declared in this class. /// The properties declared in this class.
/// ///