craftinginterpreters icon indicating copy to clipboard operation
craftinginterpreters copied to clipboard

Make errors

Open Big-Mande opened this issue 1 year ago • 5 comments

I was able to use the make get command but running the make command give me these errors: tool/lib/src/book.dart:118:56: Error: The method 'listSync' isn't defined for the class 'Glob'.

  • 'Glob' is from 'package:glob/glob.dart' ('../../.pub-cache/hosted/pub.dartlang.org/glob-2.1.1/lib/glob.dart'). Try correcting the name to the name of an existing method, or defining a method named 'listSync'. for (var file in Glob("$language/**.{c,h,java}").listSync()) { ^^^^^^^^ tool/lib/src/book.dart:158:52: Error: The value 'null' can't be returned from a function with return type 'Page' because 'Page' is not nullable.
  • 'Page' is from 'package:tool/src/page.dart' ('tool/lib/src/page.dart'). if (index < 0 || index >= pages.length) return null; ^ tool/lib/src/book.dart:162:48: Error: A value of type 'Snippet?' can't be returned from a function with return type 'Snippet' because 'Snippet?' is nullable and 'Snippet' isn't.
  • 'Snippet' is from 'package:tool/src/snippet.dart' ('tool/lib/src/snippet.dart'). Snippet findSnippet(CodeTag tag) => _snippets[tag]; ^ tool/lib/src/book.dart:171:11: Error: Non-nullable variable 'last' must be assigned before it can be used. if (last == null || snippet.tag > last.tag) last = snippet; ^^^^ tool/lib/src/book.dart:171:41: Error: Non-nullable variable 'last' must be assigned before it can be used. if (last == null || snippet.tag > last.tag) last = snippet; ^^^^ tool/lib/src/book.dart:174:12: Error: Non-nullable variable 'last' must be assigned before it can be used. return last; ^^^^ tool/lib/src/mustache.dart:58:19: Error: Non-nullable variable 'chapters' must be assigned before it can be used. "chapters": chapters, ^^^^^^^^ tool/lib/src/mustache.dart:74:20: Error: Non-nullable variable 'nextType' must be assigned before it can be used. "next_type": nextType, ^^^^^^^^ tool/lib/src/page.dart:50:24: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. if (isPart) return null; ^ tool/lib/src/page.dart:51:14: Error: Property 'title' cannot be accessed on 'Page?' because it is potentially null.
  • 'Page' is from 'package:tool/src/page.dart' ('tool/lib/src/page.dart'). Try accessing using ?. instead. if (part.title == "A Tree-Walk Interpreter") return "java"; ^^^^^ make: *** [build/build.dart.snapshot] Error 254

Big-Mande avatar Aug 09 '23 19:08 Big-Mande

similar situation, I downgraded the dart to 2.19 so make-get works but then make doesn't work. Were you able to fix it? Edit: figured out that on dart 2.19.6-1 the make get and make clox seems to work.

Viha123 avatar Oct 13 '23 05:10 Viha123

similar situation, I downgraded the dart to 2.19 so make-get works but then make doesn't work. Were you able to fix it? Edit: figured out that on dart 2.19.6-1 the make get and make clox seems to work.

How did you do that exactly? I'm not from ecosystem and can't seem to figure this out.

a-y-u-s-h avatar Dec 19 '23 10:12 a-y-u-s-h

Okay, I just followed the errors and updated them by hand (thought there must be a command for this) this is updated one, but not sure if it breaks anything -

name: tool
publish_to: none
environment:
  sdk: ">=2.12.0 <3.0.0"
dependencies:
  args: ^2.0.0
  charcode: ^1.1.3
  glob: ^2.0.0
  image: ^3.0.1
  markdown: ^4.0.0
  mime_type: ^1.0.0
  mustache_template: ^2.0.0
  path: ^1.7.0
  pool: ^1.4.0
  sass: ^1.26.5
  shelf: ^1.0.0
  string_scanner: ^1.0.5

a-y-u-s-h avatar Dec 19 '23 10:12 a-y-u-s-h

installing dart v2.19.6 works for me

br8th avatar Apr 07 '24 04:04 br8th