From 523426657dc402b1c629f63a2c9f9df5c356a7ce Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Jun 2020 10:18:47 +0100 Subject: [PATCH] Remove default `Never` body, refine error messages Resolve #110. --- Sources/Tokamak/Views/AnyView.swift | 4 ++++ Sources/Tokamak/Views/Button.swift | 4 ++++ Sources/Tokamak/Views/HStack.swift | 4 ++++ Sources/Tokamak/Views/Text.swift | 4 ++++ Sources/Tokamak/Views/TupleView.swift | 4 ++++ Sources/Tokamak/Views/VStack.swift | 4 ++++ Sources/Tokamak/Views/View.swift | 13 ++++++++----- Sources/Tokamak/Views/ViewBuilder.swift | 8 ++++++++ Sources/TokamakDOM/Views/HTML.swift | 4 ++++ 9 files changed, 44 insertions(+), 5 deletions(-) diff --git a/Sources/Tokamak/Views/AnyView.swift b/Sources/Tokamak/Views/AnyView.swift index 5ed6762e1..d3e5af6f1 100644 --- a/Sources/Tokamak/Views/AnyView.swift +++ b/Sources/Tokamak/Views/AnyView.swift @@ -55,6 +55,10 @@ public struct AnyView: View { } } } + + public var body: Never { + neverBody("AnyView") + } } public func mapAnyView(_ anyView: AnyView, transform: (V) -> T) -> T? { diff --git a/Sources/Tokamak/Views/Button.swift b/Sources/Tokamak/Views/Button.swift index 39ad366d2..17ec6c58c 100644 --- a/Sources/Tokamak/Views/Button.swift +++ b/Sources/Tokamak/Views/Button.swift @@ -25,6 +25,10 @@ public struct Button